Skip to content
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

HMR not working and logging "Waiting for update signal from WDS" #2154

Closed
1 of 2 tasks
marcofugaro opened this issue Jul 27, 2019 · 17 comments
Closed
1 of 2 tasks

HMR not working and logging "Waiting for update signal from WDS" #2154

marcofugaro opened this issue Jul 27, 2019 · 17 comments

Comments

@marcofugaro
Copy link
Contributor

marcofugaro commented Jul 27, 2019

[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

@alexander-akait
Copy link
Member

alexander-akait commented Jul 27, 2019

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

@marcofugaro
Copy link
Contributor Author

Sure! I did all those things but the problem still persists.

I read the docs of webpack-dev-server and after was the most suitable hook, I opened #1509 once for this reason.

@alexander-akait
Copy link
Member

@marcofugaro anyway can you create minimum reproducible test repo?

@marcofugaro
Copy link
Contributor Author

Sure! I'll strip away the unnecessary stuff

@marcofugaro
Copy link
Contributor Author

@evilebottnawi here is the test repo

https://github.com/marcofugaro/hmr-test-repo

just npm i, npm start, and watch the browser console, when editing a file this happens:

Screenshot 2019-07-31 at 11 39 08

@hiroppy
Copy link
Member

hiroppy commented Jul 31, 2019

@marcofugaro
Copy link
Contributor Author

Alright, my bad, didn't know the whole module.hot.accept thing was needed. Tought you could hot reload anything anytime.

The issue now becomes that the message [HMR] Waiting for update signal from WDS... still appears event when clientLogLevel: 'silent', is in the config, but I'll open a separate issue for that

@PedroRuiz
Copy link

+1

@MuhammadTahir7
Copy link

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

@nhooey
Copy link

nhooey commented Dec 31, 2019

Alright, my bad, didn't know the whole module.hot.accept thing was needed. Tought you could hot reload anything anytime.

The issue now becomes that the message [HMR] Waiting for update signal from WDS... still appears event when clientLogLevel: 'silent', is in the config, but I'll open a separate issue for that

@marcofugaro: Did you open a separate issue? Got a link?

Here it is: #2166

@shaheemMPM
Copy link

@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);
		}
	}
};


@benguoztrk
Copy link

@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.

@shaheemMPM
Copy link

@benguoztrk there are some other files which log this message to the console, so try to find the file which is pushing the log
You can find that in the console of your browser. (preferred:: chrome)

@danielkv
Copy link

danielkv commented Apr 1, 2020

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

@abhishekdubey1
Copy link

@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

@manutdmohit
Copy link

"This is not working"
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);
}
}
};

@babak-bekhrad
Copy link

@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);
		}
	}
};

Thanks, it works perfectly for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests