[Ivy] App crashes at runtime with NgRx 7.x
See original GitHub issueπ bug report
Affected Package
The issue is caused by package @angular/*Is this a regression?
Yes, the previous version in which this bug was not present was: Angular version 7.xDescription
When using the latest Angular and CLI betas, and running ivy-ngcc, and the latest version of NgRx from npm, the application compiles successfully but fails at runtime.π¬ Minimal Reproduction
Reproduction steps are in the README on the repo
https://github.com/brandonroberts/ngrx-ivy-runtime-error
π₯ Exception or Error
Without adding import 'core-js/es7/reflect';
to src/polyfills.ts
and ng serve --aot
main.ts:13 Error: Dependency array must have arguments.
at reflectDependency (core.js:887)
at core.js:870
at Array.map (<anonymous>)
at convertDependencies (core.js:870)
at reflectDependencies (core.js:866)
at Function.get (core.js:956)
at getInjectableDef (core.js:312)
at injectableDefOrInjectorDefFactory (core.js:13259)
at providerToFactory (core.js:13297)
at providerToRecord (core.js:13281)
With import 'core-js/es7/reflect';
to src/polyfills.ts
and ng serve --prod
Error: Angular JIT compilation failed: '@angular/compiler' not loaded!
- JIT compilation is discouraged for production use-cases! Consider AOT mode instead.
- Did you bootstrap using '@angular/platform-browser-dynamic' or '@angular/platform-server'?
- Alternatively provide the compiler with 'import "@angular/compiler";' before bootstrapping.
at Ae (core.js.pre-build-optimizer.js:448)
at Ge (core.js.pre-build-optimizer.js:869)
at ze (core.js.pre-build-optimizer.js:866)
at Function.get (core.js.pre-build-optimizer.js:20742)
at ge (core.js.pre-build-optimizer.js:320)
at e.processInjectorType (core.js.pre-build-optimizer.js:13161)
at core.js.pre-build-optimizer.js:13179
at core.js.pre-build-optimizer.js:13340
at Array.forEach (<anonymous>)
at va (core.js.pre-build-optimizer.js:13340)
@angular/compiler
is already imported in the main.ts
file before bootstrapping. Disabling buildOptimizer
causes the app to run successfully.
π Your Environment
Angular Version:
Angular CLI: 8.0.0-beta.4
Node: 10.14.2
OS: linux x64
Angular: 8.0.0-beta.6
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.14.0-beta.2
@angular-devkit/build-angular 0.14.0-beta.2
@angular-devkit/build-optimizer 0.14.0-beta.2
@angular-devkit/build-webpack 0.14.0-beta.2
@angular-devkit/core 8.0.0-beta.4
@angular-devkit/schematics 8.0.0-beta.4
@angular/cli 8.0.0-beta.4
@ngtools/webpack 8.0.0-beta.2
@schematics/angular 8.0.0-beta.4
@schematics/update 0.14.0-beta.4
rxjs 6.4.0
typescript 3.2.4
webpack 4.29.5
Anything else relevant?
NgRx versions
"@ngrx/effects": "^7.2.0",
"@ngrx/entity": "^7.2.0",
"@ngrx/schematics": "^7.2.0",
"@ngrx/store": "^7.2.0",
"@ngrx/store-devtools": "^7.2.0",
cc: @IgorMinar @kara @alxhub
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top Results From Across the Web
NgRx Effects crashing Angular app with infinite loop
Every time you update, the effect will try to update again, and again, and again :P. To make this work, just remove countActionsType....
Read more >Angular Debugging Tips and Tricks | All Front - AllFront.io
In this article, we'll cover some debugging tips and tricks we've learnt along the way. Tips for Debugging Angular Applications.
Read more >The Complete Guide To Angular Load Time Optimization
In the past, I have written a lot about performance tuning Angular apps. Now it is time to dive into one of the...
Read more >The NgRX store resets after a browser refresh in Angular (7 ...
Let's look at it logically. So you already have some information in your current state and now you want to persist that even...
Read more >Angular Ngrx DevTools: Important Practical Tips
Another common source of hard to debug errors while building a store application is the possibility of some component in our component tree...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thx for looking into it, @alexzuza! It sounds like this issue might not be uncommon, so it is probably a good idea to try and fix in ngcc too.
FYI, there are some ngcc-related fixes/improvements in-flight (#28963, #29092, #29119, #29209). I think it makes sense to get those in first and then investigating this one.
These issues seem to be resolved as of the latest beta (8.0.0-beta.13). Iβve updated the repo and removed the workarounds.
https://github.com/brandonroberts/ngrx-ivy-runtime-error