angular - Angular 8 启用常春藤错误 - FirebaseModule 的 NgModule.importss 中位置 0 的值不是参考:[object Object]
问题描述
我在 github 中有一个 repo,你可以在这里看到,我正在尝试启用 Ivy,但还没有运气。
显示的错误是:
ERROR in src/app/shared/modules/firebase.module.ts(7,12): error TS-991010: Value at position 0 in the NgModule.importss of FirebaseModule is not a reference: [object Object]
node_modules/@ismaestro/ngx-scroll-to-first-invalid/ngx-scroll-to-first-invalid.module.d.ts(1,22): error TS-996002: Appears in the NgModule.imports of SharedModule, but could not be resolved to an NgModule class
node_modules/@ismaestro/ngx-scroll-to-first-invalid/ngx-scroll-to-first-invalid.module.d.ts(1,22): error TS-996003: Appears in the NgModule.exports of SharedModule, but could not be resolved to an NgModule, Component, Directive, or Pipe class
src/app/shared/shared.module.ts(58,14): error TS-996002: Appears in the NgModule.imports of HeroesModule, but itself has errors
src/app/shared/modules/firebase.module.ts(18,14): error TS-996002: Appears in the NgModule.imports of AppBrowserModule, but could not be resolved to an NgModule class
src/app/shared/shared.module.ts(58,14): error TS-996002: Appears in the NgModule.imports of AppBrowserModule, but itself has errors
src/app/app.browser.module.ts(71,14): error TS-996002: Appears in the NgModule.imports of AppServerModule, but itself has errors
重现步骤:
- 克隆 repo:https ://github.com/Ismaestro/angular8-example-app.git 。
在这个文件中 tsconfig.browser.ts像这样启用 Ivy:
"angularCompilerOptions": { "enableIvy": true }
跑:
npm i npm start
我不知道该怎么办... :D
谢谢!!
伊斯玛
解决方案
我遇到了同样的问题,这可能是由于一些第三方库不遵守 Angular 库格式规范并使用一些自定义 webpack 配置编译他们的库。在我的情况下,它是@auth0/angular-jwt,我提出了一个 PR 来解决这个问题,目前没有合并(https://github.com/auth0/angular2-jwt/pull/622)
由您来找出您的哪个部门不遵守 angular lib 规范。
推荐阅读
- java - 在不控制底层协议的情况下确保套接字连接
- vba - 通过宏重新启动 PowerPoint 演示文稿
- amcharts - AmCharts如何防止数据标签溢出?
- google-cloud-platform - GKE 上的 Knative 无法处理某些图像,显示 RevisionMissing 错误
- c# - 如何修复 JPG 文件中的 EXIF 方向数据
- node.js - 我如何将 jsdoc 参数发送到 Web 请求?
- flutter - Flutter:使用固定的 tabBar 折叠应用栏
- java - Eclipse Maven 依赖 - weaveDependency 问题
- janusgraph - 已超过最大帧长度 65536
- python - 如何在 jinja2 模板中运行 python 追加列表