siv*_*ivu 3 angular-material angular ionic5
Angular JIT 编译失败:“@angular/compiler”未加载!
在开发模式下构建生产构建时出现此错误,但没有出现任何错误
您可以尝试以下任一解决方案:
解决方案1
运行以下命令来更新所有依赖项,因为它们可能存在一些不兼容性:
npm update
Run Code Online (Sandbox Code Playgroud)
解决方案2
确保您已'@angular/compiler'在文件的最顶部导入main.ts。
现在设置以下行
aot=true
Run Code Online (Sandbox Code Playgroud)
在angular.json文件中。
另外,设置以下行
scripts{
"postinstall": "ngcc --properties es2015 browser module main --first- only --create-ivy-entry-points"
}
Run Code Online (Sandbox Code Playgroud)
文件package.json,然后删除node_modules文件夹和package-lock.json文件,然后运行以下命令:
npm install
Run Code Online (Sandbox Code Playgroud)
解决方案3
在文件中禁用 Ivy 引擎tsconfig.json:
"angularCompilerOptions": { "fullTemplateTypeCheck": true, "strictInjectionParameters": true, "enableIvy": false }
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
22228 次 |
| 最近记录: |