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

后端 未结 25 1888
佛祖请我去吃肉
佛祖请我去吃肉 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 12:51

    I got this error when I made the bonehead mistake of importing MatSnackBar instead of MatSnackBarModule in app.module.ts.

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

    Work for me

    angular.json

    "aot": false
    
    0 讨论(0)
  • 2020-12-13 12:51

    Just go to your tsconfig.app.json in your project and remove all from it

    and copy below code and paste it. It will solve your issue :)

    /* To learn more about this file see: https://angular.io/config/tsconfig. */
    {
      "extends": "./tsconfig.json",
      "compilerOptions": {
        "outDir": "./out-tsc/app",
        "types": [],
      },
    
      "files": [
        "src/main.ts",
        "src/polyfills.ts"
      ],
      "include": [
        "src/**/*.d.ts"
      ],
      "angularCompilerOptions": {
        "enableIvy": false
      }
    }
    
    0 讨论(0)
  • 2020-12-13 12:53

    For me I was working under Ubuntu

    The error disappeared if I use sudo with ng

    sudo ng build
    sudo ng serve
    
    0 讨论(0)
  • 2020-12-13 12:54

    I had this error message because I was trying to import a component in a new module instead of importing the other module where my component was declared.

    Removing the component import from my new module and importing the other module solved it for me.

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

    Just restarting the server with command npm start did the trick. Thanks all for the suggestions.

    0 讨论(0)
提交回复
热议问题