Module build failed (from ./node_modules/@ngtools/webpack/src/index.js)

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @ngtools/webpack

Is this a regression?

No.

Description

A clear and concise description of the problem...

After updating angular version 8 to 9, when I try to execute the commands ionic serve or ng serve I get the compilation error.

πŸ”₯ Exception or Error


[ng] ERROR in ./src/zone-flags.ts
[ng] Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
[ng] Error: /home/mejia97/Documentos/CTM/ctm-front/src/zone-flags.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
[ng]     at AngularCompilerPlugin.getCompiledFile (/home/mejia97/Documentos/CTM/ctm-front/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:909:23)
[ng]     at /home/mejia97/Documentos/CTM/ctm-front/node_modules/@ngtools/webpack/src/loader.js:41:31
[ng]     at runMicrotasks (<anonymous>)
[ng]     at processTicksAndRejections (internal/process/task_queues.js:97:5)

🌍 Your Environment

Angular Version:


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / β–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 9.0.1
Node: 13.7.0
OS: linux x64

Angular: 9.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, platform-browser
... platform-browser-dynamic, router, service-worker
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.1
@angular-devkit/build-angular     0.900.1
@angular-devkit/build-optimizer   0.900.1
@angular-devkit/build-webpack     0.900.1
@angular-devkit/core              9.0.1
@angular-devkit/schematics        9.0.1
@angular/cli                      9.0.1
@angular/fire                     5.4.2
@ngtools/webpack                  9.0.1
@schematics/angular               8.1.3
@schematics/update                0.900.1
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2

Anything else relevant?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

4reactions
alan-agius4commented, Feb 14, 2020

Seems like zone-flags.ts is not part of the compilation, is zone-flags another entrypoint? Most likely this file needs to be added in the files section of your tsconfig.app.json

Edit: most likely in polyfills.ts you have an import with an extension. Ex: import './zone-flags.ts'. Removing the extension should solve the issue.

2reactions
alan-agius4commented, Feb 14, 2020

@rtpHarry, I actually update the comment, as the root cause seems to be an import with a .ts extension.

Read more comments on GitHub >

github_iconTop Results From Across the Web

16 - Stack Overflow
main.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module 'babel-preset-es2015' fromΒ ...
Read more >
Bug Report - GitHub
Bug Report Current Behavior when i try to run the command npm start i get that error : ERROR in ./main.js Module build...
Read more >
Angular - Code with Mosh Forum
Error : Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): Β· delete the node_modules folder Β· delete package-lock.jsonΒ ...
Read more >
Get Help and Help Others - RedwoodJS Community
Compiled with problems:X ERROR in ./src/components/Button/Button.tsx Module build failed (from ../node_modules/babel-loader/lib/index.js):.
Read more >
Sign in - YouTube
Module build failed (from ./node_modules/source-map-loader/dist/cjs. js ): Error: ENOENT: no such file or directory,Β ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found