【问题标题】:Angular 14, ng serve error - @ngtools/webpack/src/ivy/index.js - Error: Maximum call stack size exceededAngular 14, ng serve error - @ngtools/webpack/src/ivy/index.js - Error: Maximum call stack size exceeded
【发布时间】:2022-12-02 07:47:25
【问题描述】:

I'm working with angular 14 and node 16 and typescript. I was working normally, but now when i execute the ng serve command, i get the following error:

./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Maximum call stack size exceeded

here is my ng version

【问题讨论】:

  • Maybe you have some files that have circular dependencies (import/export)
  • Yes, i check it out and yes it was

标签: typescript angular-cli


【解决方案1】:

check the modules import , you may have circular importation

【讨论】:

    【解决方案2】:

    I got this error, as I stupidly included a package in both declarationsandimports in myapp.module.tsfile:

    @NgModule({
      declarations: [
        CanvasJSChart,
        . . .
      ],
      imports: [
        CanvasJSChart,
        . . .
    

    Moral of the story: don't drink and code.

    【讨论】:

      【解决方案3】:

      Please check module routing carefully. You may have declared same component both in declarations and imports.

      play it in this way....

      @NgModule({
        declarations: [
          FooterComponent,
          NavbarComponent
        ],
        imports: [
          CommonModule,
        ],
        exports:[
          FooterComponent,
          NavbarComponent
        ]
      })
      

      【讨论】:

        【解决方案4】:
        rm -rf node_modules
        npm install
        

        【讨论】:

          猜你喜欢
          • 2015-10-19
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2019-12-25
          • 1970-01-01
          相关资源
          最近更新 更多