Serve command not passing webpack `devServer` config to webpack-dev-server
reopening https://github.com/webpack/webpack-cli/issues/1469
here are my dev dependencies:
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/preset-env": "^7.12.1",
"@babel/preset-react": "^7.12.1",
"babel-loader": "^8.1.0",
"react-hot-loader": "^4.13.0",
"webpack": "^5.1.3",
"webpack-cli": "^4.1.0",
"webpack-dev-server": "^3.11.0"
}
my dev server details:
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 9000
}
Command:
"start": "webpack serve --config ./webpack.config.js --mode development",
What is the current behavior?
i 「wds」: Project is running at http://localhost:9000/
i 「wds」: webpack output is served from undefined
i 「wds」: Content not from webpack is served from C:\Users\lehar\scaling-todo-app\dist
The first change i make reloads, any after that do not. The only way i can see updates is by stopping and reserving, even refreshing the page doesn't show updates.
Steps to reproduce the behavior:
Define a devServer config in your webpack config file Run webpack serve --config webpack.dev.js
Closing https://github.com/webpack/webpack-cli/issues/1469#issuecomment-698267343
No need to open an issue without additional information, I can't fix something somewhere
No need to open an issue without additional information, I can't fix something somewhere
@evilebottnawi Sorry i accidentally submitted. Please reopen and see details
@lewisharveydeveloper Please create reproducible test repo, can't reproduce locally
@evilebottnawi https://github.com/lewisharveydeveloper/scaling-todo-app
see test string in app.js. when i change that string, i see the changes on first change, but no following changes
@lewisharveydeveloper you need to set target: 'web', we are working on fixes
@evilebottnawi set target to web and pushed changes to my shared repo. no change
You need hot: true also
@evilebottnawi Thanks for quick responses, set hot to true but no change unfortunately. (pushed to repo)
I will look at the problem tmorrow
@evilebottnawi Thank you :)
i've added more detail on the issue. seems like it might be something to do with cache since i don't even see changes once i refresh the tab.
No problems, works fine

@evilebottnawi I am having this same issue: 「wds」: webpack output is served from undefined. And my live reloading does not work. I can confirm that using target: 'web' gets live reloading to work but I still get the same message 「wds」: webpack output is served from undefined. Is target: 'web' a temporary solution? I'm seeing that this problem might be fixed in #1469 but it doesn't look like those changes are published in a new version yet.
@evilebottnawi i made a new folder and pulled my repo.
I ran npm install, and then npm start.
I still have the same problem, the first refresh works but no subsequent ones.
@tx-steven Yes, target: 'web' is a temporary solution
@lewisharveydeveloper still can't reproduce, all works fine
I want to close because I can't reproduce, there is not magic with new webpack serve, feel free to feedback
In original repo it doesn't work, because you have resolving problems, so webpack can't init HMR, problems with code === problems with HMR, nothing to do here
https://github.com/lewisharveydeveloper/scaling-todo-app/blob/master/src/index.js#L5 - no firebase in mode_modules