启用 Angular 9 Ivy 会引发错误
Posted
技术标签:
【中文标题】启用 Angular 9 Ivy 会引发错误【英文标题】:Enabling Angular 9 Ivy throws errors 【发布时间】:2020-10-16 20:01:17 【问题描述】:我已将我的应用程序更新到 Angular 9。当我禁用 ivy 时,我能够运行该应用程序。但是当我启用常春藤得到错误error NG6002:
错误日志 -
32 export class FooterModule
~~~~~~~~~~~~
src/app/core/ncpapp.core.module.ts:30:14 - error NG6002: Appears in the NgModule.imports of
ScreenEditorModule, but itself has errors
30 export class CoreModule
~~~~~~~~~~
src/app/core/ncp-forms/ncp.forms.module.ts:19:14 - error NG6002: Appears in the NgModule.imports of
ScreenEditorModule, but itself has errors
19 export class NCPFormModule
~~~~~~~~~~~~~
node_modules/ngx-jsoneditor/jsoneditor.module.d.ts:[93m5:22 - error NG6002: Appears in the
NgModule.imports of ScreenEditorModule, but could not be resolved to an NgModule class.
This likely means that the library (ngx-jsoneditor) which declares JSONEditorModule has not been
processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the
library is available, and update if so. Also consider checking with the library's authors to see if
the library is expected to be compatible with Ivy.
我尝试卸载库ngx-jsoneditor
并重新安装,但仍然遇到同样的问题。
我做了npm cache clean --force
和npm install
,但结果是一样的。
我有什么遗漏吗?
【问题讨论】:
【参考方案1】:安装与 ivy 兼容的新版 ngx-jsoneditor。
【讨论】:
以上是关于启用 Angular 9 Ivy 会引发错误的主要内容,如果未能解决你的问题,请参考以下文章
构建启用了Ivy的monorepo Angular9库是个坏主意
StackBlitz ngcc 在启用 Ivy 的情况下无法在我的 npm 库上运行