Angular 14, ng serve error - @ngtools/webpack/src/ivy/index.js - Error: Maximum call stack size exceeded

Viewed 3005

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

enter image description here

3 Answers

check the modules import , you may have circular importation

I got this error, as I stupidly included a package in both declarations and imports in my app.module.ts file:

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

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

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
  ]
})
Related