Webpack-dev-server: Doesn't work hot reload with browserslist config

Created on 3 Nov 2020  路  3Comments  路  Source: webpack/webpack-dev-server


Bug report




What is the current behavior?
After editing code it should perform hot reload.
In console no correct initialization, it stops on waiting.

[HMR] Waiting for update signal from WDS...

If the current behavior is a bug, please provide the steps to reproduce.

  • clone repository
  • install packages npm install
  • start server with npm start
  • open browser (chrome, edge) on localhost:8000
  • try to change text in src/main.js
  • ...there no hot reload...
  • now try to delete .browserslistrc and restart server
  • open browser and try to edit code.
  • ...hot reload should be performed...






What is the expected behavior?
After editing code it should perform hot reload.
There should be correct initialization in console:

[HMR] Waiting for update signal from WDS...
[WDS] Hot Module Replacement enabled.
[WDS] Live Reloading enabled.


Other relevant information:
webpack version: 5.4.0

I tested with 4.44.2 and there no such issue.

Node.js version: 14.15.0 and 15.0.1
Operating System: OSX
Additional tools:
Chrome 86.0.4240.111
Edge 86.0.622.61

Most helpful comment

It seems that it's duplicate of https://github.com/webpack/webpack-dev-server/issues/2758

As workaround in webpack config add target

module.exports = {
  ...webpackConfig,
  target: 'web', // only for develomplent
}

All 3 comments

Yep, target: 'browserslist' is not supported right now

It seems that it's duplicate of https://github.com/webpack/webpack-dev-server/issues/2758

As workaround in webpack config add target

module.exports = {
  ...webpackConfig,
  target: 'web', // only for develomplent
}

Yep, duplicate, let's close, right workaround, tomorrow I will start fix it for webpack-dev-server

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mischkl picture mischkl  路  3Comments

Jack-Works picture Jack-Works  路  3Comments

hnqlvs picture hnqlvs  路  3Comments

tulika21-zz picture tulika21-zz  路  3Comments

piotrszaredko picture piotrszaredko  路  3Comments