YeisonM
YeisonM

Reputation: 597

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

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

Upvotes: 23

Views: 59590

Answers (4)

Parth Developer
Parth Developer

Reputation: 1867

rm -rf node_modules
npm install

Upvotes: 0

Saleh Sayeem
Saleh Sayeem

Reputation: 119

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

Upvotes: 7

Mike Gledhill
Mike Gledhill

Reputation: 29161

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.

Upvotes: 22

Ilyas Ayuubi
Ilyas Ayuubi

Reputation: 526

check the modules import , you may have circular importation

Upvotes: 38

Related Questions