简体   繁体   English

Angular v8 到 v11 - 禁用常春藤的 entryComponents 问题

[英]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.

相关问题 angular v11 + Scss 编译失败 - angular v11 + Scss failed to compile Angular V11:NullInjectorError:没有 ControlContainer 的提供程序 - Angular V11: NullInjectorError: No provider for ControlContainer 使用 Kendo 编译 Angular v8 项目时出现 IVY 错误 - IVY Error while compiling Angular v8 project with Kendo 在架构中找不到“tsconfig”-将 tslint 迁移到 eslint (Angular v11) - 'tsConfig' is not found in schema - Migrating tslint to eslint (Angular v11) 如何测试动态加载组件的 Angular (v11) 组件 - How test an Angular (v11) component that loads components dynamically Angular 9 Ivy entryComponents 转换 - Angular 9 Ivy entryComponents conversion 将 Angular 从 v8 更新到 v9 并启用 ivy 为 true 后,组件在开始时未加载 - After updating Angular from v8 to v9 and enabling ivy to true, component is not loading at beginning Angular Ivy 忽略 entryComponents 设置 - Angular Ivy ignoring entryComponents setting Angular 自定义材质主题在 v11 到 14 升级后未加载 - Angular Custom Material Theme not loading after v11 to 14 upgrade Angular 2+ (v11) 自动将 URL 中的片段 hash (#) 编码为 %23 - Angular 2+ (v11) automatically encode fragment hash (#) in URL into %23
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM