Skip to content

Webpack version 5 HMR not work #20288

Closed
@caoyi5225

Description

@caoyi5225

🐞 Bug report

Command (mark with an x)

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

Description

Webpack v5 HMR not work

🔬 Minimal Reproduction

  • ng new ng11_demo1
  • add "resolutions": { "webpack": "5.24.4" } in package.json and update all angular dependencies to 12.0.0-next.4 and "@angular-devkit/build-angular" to 0.1200.0-next.4
  • yarn
  • yarn ng serve --hmr
  • modify "Welcome" to "Welcome1" in app.component.html

🔥 Exception or Error

The page doesn't change automatic and console this error:

Uncaught TypeError: Cannot read property 'push' of undefined
    at self.webpackHotUpdateng11_demo1 (jsonp chunk loading:51)
    at runtime.afd237f104deb82b7462.hot-update.js:1
self.webpackHotUpdateng11_demo1 @ jsonp chunk loading:51
(anonymous) @ runtime.afd237f104deb82b7462.hot-update.js:1

And when I refresh page,one more error:

Uncaught TypeError: Cannot set property '9229' of undefined
    at self.webpackHotUpdateng11_demo1 (jsonp chunk loading:47)
    at main.afd237f104deb82b7462.hot-update.js:1
self.webpackHotUpdateng11_demo1 @ jsonp chunk loading:47
(anonymous) @ main.afd237f104deb82b7462.hot-update.js:1

🌍 Your Environment

Angular CLI: 12.0.0-next.4
Node: 14.15.0
OS: darwin x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1200.0-next.4
@angular-devkit/build-angular   0.1200.0-next.4
@angular-devkit/core            12.0.0-next.4
@angular-devkit/schematics      12.0.0-next.4
@schematics/angular             12.0.0-next.4
@schematics/update              0.1200.0-next.4
rxjs                            6.6.6
typescript                      4.0.7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions