Error: Angular JIT compilation failed: '@angular/compiler' not loaded!
See original GitHub issueπ bug report
Affected Package
Not sure, but maybe @angular/compiler
or @angular/cli
Is this a regression?
Yes it was working with angular 8 and I think angular 9. (Iβve migrated both in a row after doing some test in V9 to check it was working. But maybe Iβve missed something in my tests)
Iβm trying to complete migration, no compilation error, apps run in browser as long as I donβt set optimization
build option in angular.json
Description
If I set "optimization": true
in angular.json I have the following error in my browser (no compilation error even with AOT)
main-es2015.83cd1a7f2902ea042a79.js:1 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.
π¬ Minimal Reproduction
Currently donβt manage to isolate where the issue comes from so Iβm not able to create a reproduction sample repo. I know I have some custom bootstraping pre-process, but I donβt think thatβs the issue Ivy is on (wasnβt in V8 and V9), OAT is and was on, optimization was on too when I was in V8
π₯ Exception or Error
main-es2015.83cd1a7f2902ea042a79.js:1 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 z (main-es2015.83cd1a7f2902ea042a79.js:1)
at Function.get (main-es2015.83cd1a7f2902ea042a79.js:1)
at We (main-es2015.83cd1a7f2902ea042a79.js:1)
at cs (main-es2015.83cd1a7f2902ea042a79.js:1)
at main-es2015.83cd1a7f2902ea042a79.js:1
at os.processProvider (main-es2015.83cd1a7f2902ea042a79.js:1)
at main-es2015.83cd1a7f2902ea042a79.js:1
at main-es2015.83cd1a7f2902ea042a79.js:1
at Array.forEach (<anonymous>)
at we (main-es2015.83cd1a7f2902ea042a79.js:1)
π Your Environment
Angular Version:
Angular CLI: 10.0.5
Node: 14.8.0
OS: win32 x64
Angular: 10.0.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker
Ivy Workspace: Yes
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.1000.5
@angular-devkit/build-angular 0.1000.5
@angular-devkit/build-ng-packagr 0.1000.5
@angular-devkit/build-optimizer 0.1000.5
@angular-devkit/build-webpack 0.1000.5
@angular-devkit/core 10.0.5
@angular-devkit/schematics 10.0.5
@angular-devkit/schematics-cli 0.1000.5
@angular/cdk 10.1.3
@angular/cli 10.0.5
@angular/flex-layout 10.0.0-beta.32
@angular/http 7.2.16
@angular/material 10.1.3
@angular/material-moment-adapter 10.1.3
@angular/pwa 0.1000.5
@ngtools/webpack 10.0.5
@schematics/angular 10.0.5
@schematics/schematics 0.1000.5
@schematics/update 0.1000.5
ng-packagr 10.0.3
rxjs 6.6.2
typescript 3.9.7
webpack 4.43.0
Anything else relevant?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
@no-more - could you provide a runnable reproduction of this issue? It is very hard to debug just from the error message.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.