Skip to content

Angular 11 with webpack 5 breaks with webpackMissingModule on recompilation #19934

Closed
@jawadsh123

Description

@jawadsh123

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

No, breaks after moving to webpack 5

Description

An Angular 11 app with webpack 5 breaks after recompilation (for changes on certain files)

Cannot find module '@angular/core'
at webpackMissingModule ...

🔬 Minimal Reproduction

🔥 Exception or Error

image

🌍 Your Environment


Angular CLI: 11.1.2
Node: 14.15.1
OS: linux x64

Angular: 11.1.1
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1101.2
@angular-devkit/build-angular   0.1101.2
@angular-devkit/core            11.1.2
@angular-devkit/schematics      11.1.2
@angular/cli                    11.1.2
@schematics/angular             11.1.2
@schematics/update              0.1101.2
rxjs                            6.6.3
typescript                      4.0.5

Anything else relevant?

Originally I had posted this on webpack webpack/webpack#12561
reason for my suspicion was this recent change to rebuildModule in webpack 5 -> webpack/webpack#11433
and the dependency of AngularWebpackPlugin on rebuildModule
But my understanding of both the tools is fairly limited, and webpack folks think this might be a deeper incompatibility with webpack 5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions