webpack-dev-server: webpack-dev-server goes into infinite compile loop after making the smallest change to the source code

Hi Guys.

I have an issue when webpack-dev-server goes into infinite compile loop after any change to the source code. The same code works without this issue for my colleague. And it doesn’t go into infinite loop every time: sometimes it will compile only once and stop (so works as it should), but sometimes it goes into frenzy mode. In the the verbose log attached on the first change it compiled only once and stopped, but after I did another change it went into infinite loop. webpack-dev-server.log

I’ve added my package.json, package-lock.json, and webpack folder to the zip file webpack-dev-server-infinite-loop.zip

    "webpack-cli": "4.9.2",
    "webpack-dev-server": "3.11.2",
    "webpack-merge": "5.8.0",
    "webpack-notifier": "1.15.0",
    "workbox-webpack-plugin": "6.5.1"

Symptoms: When I make a change to the component - webpack-dev-server recompiles it, but doesn’t stop after the first cycle and keeps doing it: code-change-example-causing-it browser-console intellij-console

I’ve tried to play with webpack related libraries versions, npm and node versions, clearing all caches for gradle, maven, intellij. Modified webpack configuration files to exclude things from watched. Removed and cloned the repository. Generated a new appliation with JHipster and compared generated webpack configs with mine, tried to make different changes. Nothing helps.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 23 (12 by maintainers)

Most upvoted comments

There are a lot of different problems here, please provide reproducible test repo before ask a help, without it we can’t help you

Hi, I’m getting this problem without having the devServer key in my config at all…

The repo is skaut/shared-drive-mover

We need to add additionalProperties: false, let’s do it

Please firstly update webpack-dev-server to v4

This was, actually, how I noticed the issue: I was in the process of updating front-end libraries and migrated webpack-dev-server from v3 to v4. Later when testing it I found that it goes into infinite loop. At first I thought that something was wrong with my webpack configs and I modified them many times. Couldn’t resolve it and after few days switched back to the previous version. But then I noticed that the issue still exists. After that I checked out few months old code from master branch, cleared all caches, removed all libraries, let npm and gradle to re-download all dependencies and even downgraded intellij version. It didn’t help. The same source code works without issue for my colleague 😦 I start thinking that it is not webpack related, but something on my pc intervenes and modifies the files and in this way triggers recompiling. Like antivirus, but I don’t have any… Any ides what it can be?