Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): Error: Emit

Build at: 2022-09-14T11:34:20.503Z - Hash: c51f599b4586fb6d - Time: 7780ms

./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): Error: Emit

./src/polyfills.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): Error: Emit

Error: Failed to initialize Angular compilation - Cannot read properties of null (reading 'fileName')

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

× Failed to compile.

like image 340
rakista258 Avatar asked Sep 09 '25 20:09

rakista258


1 Answers

Check this One, May be helpful Basic reason behind this can be... Recursive calls to some modules.

for e.g.

@NgModule({
     declarations: [],
     imports: [
        CommonModule,
        MatSliderModule,
        MaterialModule
     ],
     exports:[MatSliderModule]
    })
    export class MaterialModule { }

Here, Same MaterialModule is importing self. It increases the the call stack and results into the above mentioned error.

This is one condition. There can be other conditions.

like image 169
Sudarshan Gaikwad Avatar answered Sep 15 '25 12:09

Sudarshan Gaikwad