-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
newTree.optimize is not a function - Error with ng g lib
#640
Comments
it seems to be a problem with angular-cli. Last version working was @angular/cli@6.1.0-rc.0, see angular/angular-cli#11532 |
I have the same problem. |
6.1.0 cli is released. Hope nx support it soon. |
Same here with This resolved an issue: |
I tried the @jviaches solution, and worked. so the bug is in @angular/cli > 6.1.0-rc.0 |
Got the same issue :/ |
Hoping this helps whoever is hunting this bug down... This is probably a problem with @angular-devkit/schematics(-cli). I'm creating my own schematics and I have @angular/cli@latest installed but I get this error if I install any version of the devkit after @angular-devkit/schematics-cli@0.7.0-rc.0 My schematics project package.json has the following installed |
Getting this error so reverted back to 6.1.0-rc.0, now getting "Could not find an NgModule. Use the skip-import option to skip importing in NgModule" Beginning to dig into this now...following here hoping for a resolution. Thx. |
Deleting |
Angular CLI 6.1 will be supported by Nx 6.2, which is going to be released soon. |
ng -v ` Package Version@angular-devkit/architect 0.7.1 ` Reverting back to 6.1.0-rc.0 does not seem to work. For me at least. Result after reverting and redoing yarn (after deleting node_modules):
Any patches/workarounds in the meantime? |
Update: I uninstalled nrwl/schematics and the angular/cli from global then reinstalled. Deleted the project folder and recreated the project using the create-nx-workspace command. I have to refer to 0.6.8 in the ng add @angular/pwa@0.6.8 in order to add the pwa. That worked correctly. Once that was all done, I used the ng g lib common-ui (instead of common-core; mainly it seems semantically better) and it seems to be working. I did notice this its was generating the lib:
I noticed earlier and updated each peer dependency and that is where I think the issues started to occur. Do you think that when trying to update to the correct peers, there is a chance the link mismatching? I did not do the updates to the peers this time and everything seems to work so far. |
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. |
Command
Error
Env
The text was updated successfully, but these errors were encountered: