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] Waiting for update signal from WDS... is not affected by clientLogLevel: 'silent' #2166

Closed
1 of 2 tasks
marcofugaro opened this issue Aug 1, 2019 · 11 comments
Closed
1 of 2 tasks

Comments

@marcofugaro
Copy link
Contributor

[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
  • open browser console

webpack.config.js

module.exports = {
  mode: 'development',
  devServer: {
    host: '0.0.0.0',
    port: '8080',
    clientLogLevel: 'silent',
    // enable HMR
    hot: true,
  },
  plugins: [
    new HtmlWebpackPlugin({
      inject: true,
      template: './src/index.html',
    }),
  ],
}

Expected Behavior

When having clientLogLevel: 'silent', in the devServer options, nothing should be logged to the browser console

Actual Behavior

[HMR] Waiting for update signal from WDS... is logged to the browser console:

image

@alexander-akait
Copy link
Member

PR welcome, not priority

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


@shivaparashar78
Copy link

what to do when i get this type of error
[HMR] waiting for update signal from WDS .....log.js in my react
I know this might be issue in webpack but how can i get rid of

@raiskila
Copy link

The solution I'm using for silencing info-level messages from both the terminal and browser console when using webpack v5.8.0 and webpack-dev-server v4.0.0-beta.0 is to:

  • Add infrastructureLogging: { level: 'warn' } to webpack config
  • Patch line 1 of hot/log.js in webpack to var logLevel = "warn";
  • Patch line 8 of client-src/default/utils/log.js in webpack-dev-server to const defaultLevel = 'warn';

@alexander-akait
Copy link
Member

You should not patch nothing, just set infrastructureLogging: { level: 'warn' }

@raiskila
Copy link

Hi @alexander-akait,

I haven't found another way to suppress the info-level logging in the browser devtools console. Repro. Tested on Mac Safari/Chrome.

@alexander-akait
Copy link
Member

client.logging: 'warn', anyway we respect infrastructureLogging value

@grzegorzjudas
Copy link

I'm getting hundreds of log messages in Chrome DevTools every time HMR rebuilds, things like:

[WDS] 71% - sealing (X optimization).

that indicate progress. It's polluting the console so much it becomes useless. Weird thing is, I already have clientLogLevel set to silent in the config. Tried with multiple different options and levels, nothing worked.

Then, I added a CLI flag --client-log-level silent and it worked, nothing printed in the console. Sounds like (at least for that property) the config value is ignored?

@alexander-akait
Copy link
Member

@grzegorzjudas yep, we have the bug and the PR, so it is beta, I think we will do new beta at the end of week with many fixes

@alexander-akait
Copy link
Member

Close in favor #2932, will be fixed in near future

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

This worked for me very good. Thanks!

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

No branches or pull requests

7 participants