[英]Angular v8 to v11 - entryComponents issue with Ivy disabled
I've run into an issue with my project's entryComponents once I migrated from v8 to v11.从 v8 迁移到 v11 后,我的项目 entryComponents 遇到了问题。
For the moment I need to disable the Ivy build because I need to stick with the PrimeNG v8 components, and assumed if running 11 with the old build engine the entryComponents array would still be required.目前我需要禁用 Ivy 构建,因为我需要坚持使用 PrimeNG v8 组件,并假设如果使用旧构建引擎运行 11,仍然需要 entryComponents 数组。 But whenever I trigger a dialog that has an entryComponent embedded I get:
但是,每当我触发一个嵌入了 entryComponent 的对话框时,我都会得到:
Error: No component factory found for DynamicDialogComponent. Did you add it to @NgModule.entryComponents?
This component in the error is not one of my entryComponents, but a PrimeNG one I use for the dialogs.错误中的这个组件不是我的 entryComponents 之一,而是我用于对话框的 PrimeNG 组件。 If I turn Ivy on, the application is fine - but only in dev mode.
如果我打开常春藤,应用程序很好 - 但仅限于开发模式。 If built for prod it moans about the Prime modules being out of date, so I need it off until I have time to refactor.
如果是为 prod 构建的,它会抱怨 Prime 模块已经过时,所以我需要关闭它,直到我有时间重构。
Is there a way to define these entryComponents in v11 with Ivy off?有没有办法在关闭 Ivy 的情况下在 v11 中定义这些 entryComponents?
Thanks!谢谢!
Ok, so the problem is resolved and I'm ashamed to say it was a silly one: Somehow (probably during the initial Prime migration to 11) the DynamicDialogModule had been removed from all modules:好的,所以问题解决了,我很惭愧地说这是一个愚蠢的问题:不知何故(可能在最初的 Prime 迁移到 11 期间)DynamicDialogModule 已从所有模块中删除:
import { DynamicDialogModule } from 'primeng/dynamicdialog';
Added it back everywhere and the problem's gone.到处添加它,问题就消失了。 I'll get my coat.... :(
我去拿我的外套.... :(
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.