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

nx v6.2.0 is not able to generate lazy routing module when using typescript 2.9.2 #684

Closed
xmlking opened this issue Aug 9, 2018 · 6 comments

Comments

@xmlking
Copy link
Contributor

xmlking commented Aug 9, 2018

How to reproduce:

  1. create new workspace and webapp
  2. update typescript version to 2.9.2 in package.json
  3. try generating following modules
ng g lib dashboard      --routing --lazy --prefix=ngx --parent-module=apps/webapp/src/app/app.module.ts       --tags=layout,entry-module
# this will fail silently 
ng g lib grid           --routing --lazy --prefix=ngx --parent-module=libs/dashboard/src/lib/dashboard.module.ts   --tags=child-module

Success path:

if you change typescript version back to 2.7.2 , above generate commands works

@isaacplmann
Copy link
Collaborator

isaacplmann commented Aug 9, 2018

@xmlking Thanks for tracking down the workaround. I had noticed this too, but I chose to just manually enter the code instead of finding a solution.

@edcarroll
Copy link

I've found this also stops you from being able to generate applications. Am manually downgrading to TS 2.7 if I need to generate one for now.

@FrozenPandaz
Copy link
Collaborator

Sorry, I know everyone want's the latest and greatest but please do not use typescript@2.9.2 and stick to typescript@~2.7.2. We need to wait for @angular/cli@~6.2.0 is released. We can keep this issue to track typescript@~2.9.2 support.

@gkamperis
Copy link

gkamperis commented Aug 11, 2018

@xmlking
I cannot reproduce it.
I am using the latest angular/cli@6.1.3
I tried both a migrated app and a brand new Nx workspace app and all commands succeed.

create-nx-workspace myapp
cd .\myapp
npm i typescript@2.9.2
ng generate app myapp
ng g lib dashboard --routing --lazy --prefix=ngx --parent-module=apps/myapp/src/app/app.module.ts
ng g lib grid --routing --lazy --prefix=ngx --parent-module=libs/dashboard/src/lib/dashboard.module.ts
npm run start

@FrozenPandaz a fair point but not always an option...
for example 2.9.2 fixes important bugs relating to AOT and the cli optimizer that might be required

@FrozenPandaz
Copy link
Collaborator

@nrwl/schematics@6.4.0 will ship with typescript@2.9.2 so the versions do not mismatch anymore.

Fixed with #783

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants