【发布时间】:2020-06-28 18:12:06
【问题描述】:
我将 Angular 应用程序从 v8 升级到 v9。该项目使用 Angular 8 和 moment.js 导入自定义 UI 库。
当我构建它时:
- 会生成警告:
WARNING in Entry point '@myLib/catalogue' contains deep imports into
'/Users/xyz/Projects/forms-frontend/node_modules/moment/locale/de'.
This is probably not a problem, but may cause the compilation of entry points to be out of order.
在库的@myLib/catalogue.js 文件中(在node_modules 文件夹内),moment.js DE 语言环境导入如下:
import 'moment/locale/de';
- 也会触发编译错误:
ERROR in Failed to compile entry-point @myLib/catalogue (es2015 as esm2015) due to compilation errors:
node_modules/@myLib/catalogue/fesm2015/catalogue.js:213:26 - error NG1010: Value at position 2 in the NgModule.imports of FormInputModule is not a reference: [object Object]
213 imports: [
~
214 CommonModule,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
219 TranslateModule
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
220 ],
~~~~~~~~~~~~~~~~~
警告文本似乎准确地解释了编译错误,其中位置(在本例中为 2)超出了导入数组的范围。
我看过不同的文章/github issues关于深层链接,但没有有效的解决方案。
【问题讨论】:
-
我也遇到了同样的问题,请问您知道出了什么问题吗?
标签: angular deeplink angular-cli-v9