angular-cli: Out of memory exception when upgrading to v8 with ng-update
π Bug report
Command (mark with an x
)
- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [x] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Is this a regression?
No
Description
When trying to update to angular 8 I get a cryptic error message thrown when running the static query migration:
ng update @angular/cli @angular/core codelyzer --next --force --verbose
...
------ Static Query migration ------
In preparation for Ivy, developers can now explicitly specify the
timing of their queries. Read more about this here:
https://github.com/angular/angular/pull/28810
There are two available migration strategies that can be selected:
β’ Template strategy - migration tool (short-term gains, rare corrections)
β’ Usage strategy - best practices (long-term gains, manual corrections)
For an easy migration, the template strategy is recommended. The usage
strategy can be used for best practices and a code base that will be more
flexible to changes going forward.
? What migration strategy do you want to use? Template strategy
Cannot read property 'some' of undefined
Even using the verbose flag I canβt seem to get a stacktrace to track down where the error is coming from, is there way of getting that so I can track down the issue and provide a minimal repro?
π¬ Minimal Reproduction
ng update @angular/cli @angular/core codelyzer --next --force --verbose
I get that this isnβt enough to reproduce the issue your end, but if you can point me to how I can get a stack trace back out then I can narrow it down further to give a repro. Thanks!
π₯ Exception or Error
Cannot read property 'some' of undefined
π Your Environment
Angular CLI: 8.0.0-rc.1
Node: 11.13.0
OS: darwin x64
Angular: 8.0.0-rc.1
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.800.0-rc.1
@angular-devkit/build-angular 0.800.0-rc.1
@angular-devkit/build-optimizer 0.800.0-rc.1
@angular-devkit/build-webpack 0.800.0-rc.1
@angular-devkit/core 8.0.0-rc.1
@angular-devkit/schematics 8.0.0-rc.1
@angular/cdk 8.0.0-beta.0
@ngtools/webpack 8.0.0-rc.1
@schematics/angular 8.0.0-rc.1
@schematics/update 0.800.0-rc.1
rxjs 6.5.1
typescript 3.4.5
webpack 4.30.0
Anything else relevant?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 19 (16 by maintainers)
Commits related to this issue
- refactor(core): static-query migrations fails if options cannot be transformed Currently the `static-query` migrations fails at the final step of updating a query when the query already specifies opt... — committed to devversion/angular by devversion 5 years ago
- refactor(core): static-query migrations fails if options cannot be transformed Currently the `static-query` migrations fails at the final step of updating a query when the query already specifies opt... — committed to devversion/angular by devversion 5 years ago
- refactor(core): static-query migrations fails if options cannot be transformed Currently the `static-query` migrations fails at the final step of updating a query when the query already specifies opt... — committed to devversion/angular by devversion 5 years ago
- refactor(core): static-query migrations fails if options cannot be transformed (#30178) Currently the `static-query` migrations fails at the final step of updating a query when the query already spec... — committed to angular/angular by devversion 5 years ago
- refactor(core): static-query migrations fails if options cannot be transformed (#30178) Currently the `static-query` migrations fails at the final step of updating a query when the query already spec... — committed to angular/angular by devversion 5 years ago
- refactor(core): static-query migrations fails if options cannot be transformed (#30178) Currently the `static-query` migrations fails at the final step of updating a query when the query already spec... — committed to BioPhoton/angular by devversion 5 years ago
Thanks so much for the fast reply! β€οΈ I found this in our code base, removing it fixed the issue and it worked great π (4000+ files changed)
Side note:
ng update
failed with an out of memory issue. Usingnode --max_old_space_size=8192 node_modules/.bin/ng update
fixed it, and I guess anyone doing AoT builds will be used to having to use this to hack to get it to work, but it might be worth documenting this somewhere (thankfully it looks like node 12 is no longer subject to this issue as it gets configured automatically)Weβre adding a note about this problem, and the workaround, on the release blog post to increase awareness. Weβll also leave it pinned for a while on the issue tracker to make sure people see it.
Another way to address this problem is to use Node 12.1. CLI 8, and the latest versions of CLI 7, will have Node 12.1 support.
@mattlewis92 Thanks for providing that code snippet and for the feedback! π In order to prevent such confusion in the future Iβve created a fix within the migration schematic: see: https://github.com/angular/angular/pull/30178