首页 > 解决方案 > 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

重现步骤:

  1. 克隆 repo:https ://github.com/Ismaestro/angular8-example-app.git 。
  2. 在这个文件中 tsconfig.browser.ts像这样启用 Ivy:

    "angularCompilerOptions": {
       "enableIvy": true
    }
    
  3. 跑:

    npm i
    npm start
    

我不知道该怎么办... :D

谢谢!!

伊斯玛

标签: angularangular8angular-ivy

解决方案


我遇到了同样的问题,这可能是由于一些第三方库不遵守 Angular 库格式规范并使用一些自定义 webpack 配置编译他们的库。在我的情况下,它是@auth0/angular-jwt,我提出了一个 PR 来解决这个问题,目前没有合并(https://github.com/auth0/angular2-jwt/pull/622

由您来找出您的哪个部门不遵守 angular lib 规范。


推荐阅读