将依赖项升级到Angular 9并进行必要的代码更改后构建应用程序会导致错误:
编译@angular/animations:es2015作为esm2015编译 @angular/animations:es2015作为esm2015编译 @angular/core:es2015作为esm2015编译 @angular/core:es2015作为esm2015编译 @angular/core:es2015作为esm2015编译 错误:Worker#5上的错误:TypeError:无法读取null的'fileName'属性
然后它继续抛出以下错误:
编译@angular/core:es2015作为esm2015编译 @angular/compiler/testing:es2015作为esm2015编译 @angular/core:es2015作为esm2015编译 错误:尝试使用ngcc备份文件将node_modules/@angular/core/core.d.ts.__ivy_ngcc_bak写入,但已经存在,因此不会写入或备份node_modules/@angular/core/core.d.ts。
这个错误可能是因为两个或多个入口点重叠,ngcc被要求处理某些文件多次。您应该检查此包中的其他入口点,并设置一个配置以忽略您未使用的任何条目点。
编译@angular/core:es2015作为esm2015编译 发生未处理的异常:NGCC失败。
"enableIvy": false
“解决了我的问题”。 - Musikero31enableIvy
设置为false会导致项目构建后的包体积更大,那么如何能够通过这种方式解决问题呢? - Muhammad bin Yusrat