-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webpack-dev-server goes into infinite compile loop after making the smallest change to the source code #4362
Comments
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 :( |
What is os? Please use the issue template in future, there are minimum questions which we need |
Windows 10. I scanned issue template, but maybe not thoroughly enough. |
Can you remove |
I've solved it by changing ending of one word:
I don't know how could it work correctly for everyone else with just |
Do you change this options in dev server options? Because we have validation, so you should get an error... |
Yes, in devServer options. I am using these versions of libraries:
Now it looks like this:
I didn't have any validation errors neither now nor then. But I had to change regexps after switching from |
Yes, it should be validation error, @snitin315 can you look at this? |
Yes. I will look into this. |
So, this config is for v3, in which we had webpack-dev-server/lib/options.json Lines 417 to 420 in aa3cddc
In v4 we moved this to webpack-dev-server/lib/options.json Lines 996 to 1014 in 7c1d680
|
Similar is the case with other options as well which uses external API like |
We need to add |
Hi, The repo is skaut/shared-drive-mover |
Same for me. Just configured webpack as follows. And if I run Eventually I just switched to ESBuild.
{
"name": "grokking_algorithms",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"binary_search": "cd src && tsc binary-search.ts && node binary-search.js",
"start": "webpack --watch"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@types/node": "^20.1.1",
"prettier": "^2.8.8",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.0.4",
"webpack": "^5.82.0",
"webpack-cli": "^5.1.0"
}
}
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: './src/main.ts',
mode: 'development',
target: 'node',
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader',
exclude: [/test/, /\.spec\.ts$/, /\.e2e-spec\.ts$/],
},
],
},
resolve: {
extensions: ['.ts', '.json', '.js'],
},
plugins: [],
output: {
path: path.join(__dirname, 'dist'),
filename: 'main.js',
library: {
name: 'handler',
type: 'umd',
},
},
externals: [],
optimization: {
minimize: false,
},
}; |
Did this stopped infinite loop problem ? Also, I did not see webpack.config.js file. I have webpack.custom.js file. Do I need to create a file with that name? |
Where do we need to add it? |
is there any update on this issue? |
I tried even setting watch to false and it still does it |
There are a lot of different problems here, please provide reproducible test repo before ask a help, without it we can't help you |
package.json
webpack.config.dev.js
|
@OZZlE What are steps to reproduce the problem? I see you have
please make sure you ignore generated webpack file, otherwise you can have a loop of reloading |
The original problem was resolved. Anyway feel free to feedback |
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
, andwebpack
folder to the zip filewebpack-dev-server-infinite-loop.zip
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:
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.The text was updated successfully, but these errors were encountered: