Angular 8.5报错:Angular JIT compilation failed: ‘@angular/compiler‘ not loaded!

Angular 8.5报错:Angular JIT compilation failed: ‘@angular/compiler’ not loaded!

错误的具体原因

未知,先记录一下,日后深挖。

解决方法

翻看了很多博客给出的解决方法,以下解决方法出自:https://stackoverflow.com/questions/60690670/uncaught-in-promise-error-angular-jit-compilation-failed-angular-compiler/64148923

  1. Turn off the AOT by changing “aot”: true to "aot: false in angular.json file. I would not recommend this as this improves the performance of the Angular app and improves the catching of error codes in development mode.

  2. If you don’t want to change in angular.json and wants to fix this issue for ionic serve only, pass the --aot=false flag to ng command by using --: ionic serve -- --aot=false

  3. . If none the solutions above are working for you, you can run a command npm update which will update literally all the dependencies from your package.json (that means, Ionic dependencies will also be updated).
    This is a blind option because you won’t have an idea that which dependencies are updated and what are the breaking changes in those updated dependencies. So you might end up fixing other issues because of this.
    So it’s up to you to take this risk 😃 Well, this is worth doing if your app is not that big or not using any codes which are removed in the newer dependencies.;

  4. Add import ‘@angular/compiler’; in main.ts file. But this might increase the bundle size.

  5. While upgrading Ionic, you might face another issue because of wrong import in polyfills.ts. If yes, check out src/zone-flags.ts is missing from the TypeScript compilation after upgrading to Ionic 5

我的解决方法

npm install
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值