Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--sample flag question #19

Closed
NathanWalker opened this issue Aug 15, 2018 · 6 comments · Fixed by #21
Closed

--sample flag question #19

NathanWalker opened this issue Aug 15, 2018 · 6 comments · Fixed by #21

Comments

@NathanWalker
Copy link
Member

From twitter:

Hi. Was trying to test out xplat with --sample. But looks like items not added to xplat/nativescript/features. "Please add a @NgModule annotation.
../../xplat/nativescript/features/index.ts(1,15): error TS2307: Cannot find module './items'." Ideas? Thnx!

@NathanWalker NathanWalker self-assigned this Aug 15, 2018
@NathanWalker NathanWalker changed the title --sample updates --sample flag question Aug 15, 2018
@NathanWalker
Copy link
Member Author

NathanWalker commented Aug 15, 2018

When using the --sample flag you should also generate xplat with the --sample flag - search for 'Generate with a sample feature' section here: https://nstudio.io/xplat/

@bubbleheadinc
Copy link

@NathanWalker Thanks for the quick reply. I did follow the 'Generate with sample feature' docs. Not sure what I'm missing, but it seems the Items feature isn't being generated inside xplat tree.

These are the steps I took:

create-nx-workspace testxplatws  

cd testxplatws

npm install @nstudio/schematics --save-dev

ng g xplat --prefix=foo --sample

ng g app.nativescript yourapp --sample

npm i

npm run start.nativescript.yourapp.ios

And I get these errors:

ERROR in : Unexpected value 'ItemsModule in /Users/sam/dev/testxplatws/xplat/nativescript/index.ts' imported by the module 'ItemsModuleLoader in /Users/sam/dev/testxplatws/apps/nativescript-yourapp/app/features/items/items.loader.module.ts'. Please add a @NgModule annotation.
../../xplat/nativescript/features/index.ts(1,15): error TS2307: Cannot find module './items'.
app/features/items/items.loader.module.ts(9,10): error TS2305: Module '"/Users/sam/dev/testxplatws/xplat/nativescript/index"' has no exported member 'ItemsModule'.
app/features/items/items.loader.module.ts(9,23): error TS2305: Module '"/Users/sam/dev/testxplatws/xplat/nativescript/index"' has no exported member 'ItemsComponent'.
app/features/items/items.loader.module.ts(9,39): error TS2305: Module '"/Users/sam/dev/testxplatws/xplat/nativescript/index"' has no exported member 'ItemDetailComponent'.

image

@NathanWalker
Copy link
Member Author

Ah I see so likely could be 2 things:

  • could be a bug
  • could be just missing an option in the docs, try this:
ng g app.nativescript yourapp --sample --routing

Thanks for reporting this in either case. It looks like the route config may be expected to be there.

@NathanWalker
Copy link
Member Author

It looks like items weren't generated with your xplat structure so it's possible the --sample flag when ng g xplat needs an adjustment. I'll label as bug and could be a recent regression.

@bubbleheadinc
Copy link

Kewl thanks. I just tried with the --routing flag with the same results.

@NathanWalker
Copy link
Member Author

NathanWalker commented Aug 18, 2018

@bubbleheadinc this is now fixed in 6.2.2 of the schematics. If you update and then generate with --sample flag again as per the guide it will work as expected 👍

#21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants