如何使用Ivy修复Angular 9生产构建上的错误:“;目标入口点中的错误“;模块";“缺少依赖项”;

如何使用Ivy修复Angular 9生产构建上的错误:“;目标入口点中的错误“;模块";“缺少依赖项”;,angular,angular9,angular-ivy,Angular,Angular9,Angular Ivy,使用Ivy编译器在Angular 9中构建应用程序时,我得到以下消息: > ERROR in The target entry-point "device-variables" has missing dependencies: - ./lib/pages/variables-list-flat/variables-list-flat.component - ./lib/pages/variables-edit-import/variables-edit-i

使用Ivy编译器在Angular 9中构建应用程序时,我得到以下消息:

>     ERROR in The target entry-point "device-variables" has missing dependencies:
      - ./lib/pages/variables-list-flat/variables-list-flat.component
      - ./lib/pages/variables-edit-import/variables-edit-import.component       
      - ./lib/components/dialogs/set-base-path-dialog/set-base-path-dialog.component
      - ./lib/pages/variables-edit-import/structure-api.service
      - ./lib/pages/variables-list-flat/variables-list.service
      - ./lib/pages/variables/variables.component
这仅在以生产模式构建时发生

这些错误来自我在node modules文件夹中创建的库

对于上述每个错误,将打印出另一个错误。这里我只举一个例子:

>     ERROR in node_modules/device-variables/public-api.d.ts:1:15 
      - error TS2307: Cannot find module './lib/pages/variables-list-flat/variables-list-flat.component'.
      1 export * from './lib/pages/variables-list-flat/variables-list-flat.component';
但是组件确实存在。我可以在我的节点模块中看到它。在d.ts文件和js文件中

我正在通过包装器模块懒洋洋地加载模块,如本期githb底部所示:

我确实尝试导出错误输出中列出的所有文件,但它仍然抛出错误。我在库中的公共API如下所示

/*
* Public API Surface of device-variables
*/

// COMPONENTS
export * from './lib/pages/variables/variables.component';

// MODULE
export * from './lib/device-variables.module';
是否有人对如何解决此问题有任何经验或建议

或者我可以提供更多的建议和信息


谢谢

您的public-api.ts文件中有什么内容?我假设您正在导出其中的所有文件,并且还导出了一个声明这些组件的NgModule。我确实尝试公开库中的所有文件,但它仍然抛出相同的错误。我在项目中的其他库中使用了相同的技术,只以类似的方式导出了两个文件,没有抛出错误。如果可以的话,我宁愿保持它干净。你的public-api.ts文件中有什么?我假设您正在导出其中的所有文件,并且还导出了一个声明这些组件的NgModule。我确实尝试公开库中的所有文件,但它仍然抛出相同的错误。我在项目中的其他库中使用了相同的技术,只以类似的方式导出了两个文件,没有抛出错误。如果可以的话,我宁愿保持它干净。
/*
* Public API Surface of device-variables
*/

// COMPONENTS
export * from './lib/pages/variables/variables.component';

// MODULE
export * from './lib/device-variables.module';