webpack-dev-server: HMR not working and logging "Waiting for update signal from WDS"

[HMR] Waiting for update signal from WDS…

  • Operating System: macOS
  • Node Version: v12.6.0
  • NPM Version: 6.9.0
  • webpack Version: 4.38.0
  • webpack-dev-server Version: 3.7.2
  • Browser: Chrome or Firefox
  • This is a bug
  • This is a modification request

Code

Instructions for reproducible test repo (link):

  • git clone git@github.com:marcofugaro/hmr-test-repo.git
  • cd hmr-test-repo
  • npm i
  • npm start

webpack.config.js:

module.exports = {
  mode: 'development',
  devServer: {
    host: '0.0.0.0',
    port: '8080',
    publicPath: '/',
    contentBase: './public/',
    watchContentBase: true,
    watchOptions: {
      ignored: /node_modules/,
    },
    // enable HMR
    hot: true,
    hotOnly: true,
  },
  plugins: [
    // Generates an `index.html` file with the <script> injected.
    new HtmlWebpackPlugin({
      inject: true,
      template: './public/index.html',
    }),
  ],
}

Expected Behavior

HMR should work

Actual Behavior

image

The message [HMR] Waiting for update signal from WDS... appears in the console and the HMR is broken, when editing a file:

Screenshot 2019-07-31 at 11 39 08

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 4
  • Comments: 17 (7 by maintainers)

Most upvoted comments

@marcofugaro

Actually that is not an error it’s just normal working log But I also found that log annoying and get rid of it by commenting the log statement…

You can do it by following steps

  1. Goto node_modules -> webpack -> hot folder
  2. Under that you’ll find a log.js file open that
  3. edit the section (comment the log under if(level === "info") )
module.exports = function(level, msg) {
	if (shouldLog(level)) {
		if (level === "info") {
			// console.log(msg);
		} else if (level === "warning") {
			console.warn(msg);
		} else if (level === "error") {
			console.error(msg);
		}
	}
};


@marcofugaro

Actually that is not an error it’s just normal working log But I also found that log annoying and get rid of it by commenting the log statement…

You can do it by following steps

  1. Goto node_modules -> webpack -> hot folder
  2. Under that you’ll find a log.js file open that
  3. edit the section (comment the log under if(level === "info") )
module.exports = function(level, msg) {
	if (shouldLog(level)) {
		if (level === "info") {
			// console.log(msg);
		} else if (level === "warning") {
			console.warn(msg);
		} else if (level === "error") {
			console.error(msg);
		}
	}
};

Hello, I am experiencing the same issue. I already edit log.js but still got “[HMR] Waiting for update signal from WDS…” on my console.

Hey I would suggest restart the server

it just started now. it was running just fine all of the sudden. gone wrong.

[HMR] Waiting for update signal from WDS… client:48 [WDS] Hot Module Replacement enabled. client:52 [WDS] Live Reloading enabled. facing this error

Remove webpack.HotModuleReplacementPlugin, use only hot (no need hot and hotOnly), also don’t open browser in after, it is not hook for this, please read docs about options for webpack-dev-server