error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class

后端 未结 25 1977
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-13 12:43

First time using firestore and I\'m getting this error. It seems to be a problem with Ivy, from my research. I don\'t have a lot of experience modifying tsconfig.app.json, w

相关标签:
25条回答
  • 2020-12-13 13:08

    This works for me

    1. Stop the ng server(ctrl+c)

    2. Run Again

      npm start / ng serve --open
      
    0 讨论(0)
  • 2020-12-13 13:10

    Fixed it by opting out of Ivy as per documentation.

    https://angular.io/guide/ivy

    Change tsconfig.app.json to opt out of Ivy.

    "enableIvy": false
    
    0 讨论(0)
  • 2020-12-13 13:10

    This error occurs so often for me when i kept running ng serve on and trying to import same modules like RouterModule etc.

    Every time restarting the application works fine for me (ng serve) .

    0 讨论(0)
  • 2020-12-13 13:12

    Your module is not yet loaded by the Angular Server in node ng serve, so restart your server so the server loads the module that you just added in @NgModule app.module.ts

    0 讨论(0)
  • 2020-12-13 13:13

    Try to restart the server and launch it back using npm start

    0 讨论(0)
  • 2020-12-13 13:15

    I was adding service to module i.e. app.module.ts. I added it into imports array instead of providers array.

    @NgModule({
      imports: [
        MyService // wrong here
      ],
      providers: [
        MyService // should add here
      ]
    })
    export class AppModule { }
    
    0 讨论(0)
提交回复
热议问题