webpack-dev-server icon indicating copy to clipboard operation
webpack-dev-server copied to clipboard

webpack-dev-server infinite reload loop in Angular 14 app

Open gcannone opened this issue 4 years ago • 1 comments

Bug report

I have an issue after migrate my project from Angular 13 to Angular 14. When save any change to the source code, webpack-dev-server goes into infinite compile loop. There are colleagues that have the same problems and collegues that, with the same code and packages, doesn't have this issue. I've tried with other versions of webpack, re-clone project, disable cache, ecc., but nothings helps. If I remove the following assets in angular.json, it works, but these assets are necessarly and before the upgrade, the application always worked with these assets.

Actual Behavior

When I save a change with VS code (also with nothing changed), webpack-dev-server runs infinite compile loop. In console i see this logs:

[webpack-dev-server] Server started: Hot Module Replacement disabled, Live Reloading enabled, Progress disabled, Overlay enabled.

[webpack-dev-server] App updated. Recompiling... [webpack-dev-server] Disconnected! [webpack-dev-server] Trying to reconnect... [webpack-dev-server] Nothing changed. [webpack-dev-server] App updated. Recompiling... [webpack-dev-server] Nothing changed.

Expected Behavior

I expected that after save a change in source code, it reload application once, not with infinite loop of recompiling.

How Do We Reproduce?

Please paste the results of npx webpack-cli info here, and mention other relevant information

$ npx webpack-cli info

System: OS: Windows 10 10.0.19044 CPU: (16) x64 Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz Memory: 47.53 GB / 63.78 GB Binaries: Node: 16.17.0 - C:\Program Files\nodejs\node.EXE npm: 8.3.2 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: Spartan (44.19041.1266.0), Chromium (105.0.1343.42) Internet Explorer: 11.0.19041.1566 Packages: babel-loader: 8.0.6 => 8.0.6 webpack-bundle-analyzer: 4.4.0 => 4.4.0

Angular CLI: 14.2.2 Node: 16.17.0 Package Manager: npm 8.3.2 OS: win32 x64

Angular: 14.2.1 ... animations, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... router

Package Version

@angular-devkit/architect 0.1402.2 @angular-devkit/build-angular 14.2.2 @angular-devkit/core 8.3.29 @angular-devkit/schematics 8.3.29 @angular/cdk 14.0.2 @angular/cli 14.2.2 @angular/material 14.0.2 @schematics/angular 8.3.29 ng-packagr 14.0.2 rxjs 6.5.3 typescript 4.7.4

In package-lock.json, the dependencies of node_modules/@angular-devkit/build-angular are:

    "webpack": "5.74.0",
    "webpack-dev-middleware": "5.3.3",
    "webpack-dev-server": "4.11.0",
    "webpack-merge": "5.8.0",
    "webpack-subresource-integrity": "5.1.0"

gcannone avatar Sep 28 '22 08:09 gcannone

Please open an issue in @angular/cli, also without repdocubile test repo nobody can help you, sorry

alexander-akait avatar Sep 28 '22 16:09 alexander-akait