Angular - 警告 : Entry point '@libray-package' contains deep imports into 'module/file'

标签 angular typescript angular-cli

将项目升级到 Angular 9.1 后,CLI 会为各种库发出多个警告,如下所示:

Warning: Entry point '@azure/msal-angular' contains deep imports into 'node_modules/msal/lib-commonjs/utils/UrlUtils'. This is probably not a problem, but may cause the compilation of entry points to be out of order.

Warning: Entry point 'ngx-toastr' contains deep imports into 'node_modules/@angular/compiler/src/core'. This is probably not a problem, but may cause the compilation of entry points to be out of order.



我搜索了这个警告并得到了这个 Github 问题:https://github.com/angular/angular/issues/35615

这使警告消失了。但是这个警告的根本原因是什么以及如何修复它而不是仅仅抑制警告?

最佳答案

不确定这是否对您有帮助,但我通过安装来自 https://www.npmjs.com/package/ngx-toastr/v/12.0.1 的最新版本解决了相同的“ngx-toastr”警告消息。

也许旧版本的“ngx-toastr”与 Angular CLI 9.1 不兼容?

这是我的 package.json 更新后的相关部分。

.
.
.
 "ngx-toastr": "^12.0.1",
.
.
.

也许“@azure/msal-angular”可以用同样的方式解决(虽然我没有用过这个包)。

祝你好运!

罗宾

关于 Angular - 警告 : Entry point '@libray-package' contains deep imports into 'module/file' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61103612/

相关文章:

angular - "chunk"参数必须是字符串或缓冲区类型之一。接收类型对象

reactjs - 解决React/Typescript错误: Export variable is using name from external module

javascript - 路由器 socket 不工作我的组件

angular - 如何使用 angular-cli 启用 watch 进行构建?

Angular 2按钮右键单击新标签

angular - 登录后未删除查询参数(代码、状态)

javascript - 如何使用 Typescript/Javascript/Angular 4 过滤 JSON 数据?

javascript - 如何模拟 JEST 中 SUT 中使用的方法上使用的装饰器函数

angular - 具有多个入口模块的 Webpack AotPlugin

Angular 2 多个路由器 socket