Unexpected value 'undefined' declared by the module 'AppModule'

前端 未结 14 1787
庸人自扰
庸人自扰 2021-02-03 16:53

What is wrong here? I\'m trying to make it work but I get that error in the header. I have included the in the app

相关标签:
14条回答
  • 2021-02-03 17:07

    This is similar to the answer suggesting re-running ng serve, but that wasn't relevant for my situation as I have the app permanently running in IIS. In my case, I had built with ng build --watch, but stopping that and re-running it fixed the problem. I assume something was built incorrectly when it was an incremental build, but doing the full build fixed the problem.

    0 讨论(0)
  • 2021-02-03 17:12

    Try this may help you:
    Stop and Start the ng-serve service. Now the page could navigate.

    0 讨论(0)
  • 2021-02-03 17:13

    In my case it was due to build issue. may be you have added some components or other things in your App module and forgot to rebuild it. So in the browser Angular is not able to recognize your fresh entries in app module because build is required to register them properly. So for development mode kill the current server and use ng serve.

    0 讨论(0)
  • 2021-02-03 17:15

    I got the same error , sometimes this issue occur and you only need to re-run the server using ng serve or whatever CLI you use , as mentioned here

    0 讨论(0)
  • 2021-02-03 17:15

    Error in /turbo_modules/@angular/compiler@8.2.14/bundles/compiler.umd.js (2603:26) Unexpected value 'undefined' declared by the module 'AppModule'

    I had the problem that export class someClassName had used an unknown/wrong class name in one of my files (copy/paste error) and has been never registered anywhere (e.g. `AppModule.ts*).

    0 讨论(0)
  • 2021-02-03 17:17

    I faced the same error and I discovered the reason. The reason was two commas ,, in any array (for example: imports property) like this.

    @NgModule({
      imports: [
      CommonModule, FormsModule,,
    ]})
    
    0 讨论(0)
提交回复
热议问题