Webpack-dev-server: `[HMR] Waiting for update signal from WDS...` is not affected by `clientLogLevel: 'silent'`

Created on 1 Aug 2019  路  10Comments  路  Source: webpack/webpack-dev-server

[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

  • [x] This is a bug
  • [ ] This is a modification request

Code

Instructions for reproducible test repo (link):

  • git clone [email protected]: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

4 (nice to have) patch 5 (confusing) bug

Most helpful comment

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


All 10 comments

PR welcome, not priority

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


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

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';

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

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.

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

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?

@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

Close in favor https://github.com/webpack/webpack-dev-server/issues/2932, will be fixed in near future

Was this page helpful?
0 / 5 - 0 ratings

Related issues

antoinerousseau picture antoinerousseau  路  3Comments

MJ111 picture MJ111  路  3Comments

movie4 picture movie4  路  3Comments

subblue picture subblue  路  3Comments

wojtekmaj picture wojtekmaj  路  3Comments