Skip to content

No respect, no respect at all! (for stats.warningsFilter 😉) #1557

Description

@missalyss
  • Operating System: mac OS Sierra 10.12.6
  • Node Version: 6.11.1
  • NPM Version: 3.10.10
  • webpack Version: 4.19.0
  • webpack-dev-server Version: 3.1.8
  • This is a bug
  • This is a modification request

Code

webpack.config_.dev_.js

  //...
devServer: {
    host: '0.0.0.0',
    port: WEBPACK_PORT,
    watchOptions: {
      aggregateTimeout: 300,
      poll: true
    },
    stats: {
      assets: false,
      children: false,
      colors: true,
      version: false,
      hash: false,
      timings: true,
      chunks: false,
      chunkModules: false,
      warningsFilter: '[mini-css-extract-plugin]'
    },
    headers: {
      'Access-Control-Allow-Origin': '*'
    }

Webpack config stats docs I'm going off of:
https://webpack.js.org/configuration/stats/#stats

WDS stats docs:
https://webpack.js.org/configuration/dev-server/#devserver-stats-

Expected Behavior

While using stats.warningsFilter in my configuration, then it would be respected by webpack-dev-server, and that errors of anything from stats.warningsFilter would be filtered out and not posted to my browser's console. The closest to addressing logging that I can find in your code is this line, or several other lines that check for stats.colors from the same file.
Note: I am certain that my stats are connected correctly, because setting my stats.colors to false turns the colors off.

Actual Behavior

When adding warningsFilter: '[mini-css-extract-plugin]' to my config, errors from Webpack-Dev-Middleware are respected, and I no longer see them:

[webpack] ℹ 「wdm」: Compiled with warnings.

However, I am still getting my warnings in the browser's console:

screen shot 2018-11-01 at 3 41 11 pm

Which is originating from

log.warn('[WDS] Warnings while compiling.');

For Bugs; How can we reproduce the behavior?

Hmm I guess you'd need to set up a warning that you would try to filter out with your webpack config. Open browser console, errors persist with each page reload.

Note: when I update webpack-dev-server to latest version (3.1.10), problem still persists.

Thank you in advance!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions