3

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. I found that the issue is due to custom assets in angular.json for package tinymce (with ng serve verbo se I saw that webpack detect modified files in node_modules/tinymce). These assets are necessarly and before the upgrade, the application always worked with these assets. 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
2
  • Solved with custom-webpack with watchOptions to ignore node_modules changes. Commented Sep 29, 2022 at 7:59
  • on an angular project, I had this problem in all browsers, regardless of extensions. Everything was solved when I turned off the antivirus. Commented Sep 5, 2023 at 8:28

1 Answer 1

0

Go to the angular.json file and change some key value

"architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser-esbuild" //change to this value "@angular-devkit/build-angular:browser-esbuild"
        },
        "options": {
            "development": {
              "vendorChunk": false, //change to false
              "namedChunks": false //change to false
            }
          },
    }

I think now this issue is solved.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.