Skip to content

v4.0.0-beta.2 proxy logLevel silent does not work #3234

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

Closed
1 of 2 tasks
jasperkuperus opened this issue Apr 29, 2021 · 1 comment · Fixed by #3257
Closed
1 of 2 tasks

v4.0.0-beta.2 proxy logLevel silent does not work #3234

jasperkuperus opened this issue Apr 29, 2021 · 1 comment · Fixed by #3257

Comments

@jasperkuperus
Copy link

  • Operating System: macOS
  • Node Version: v12.16.2
  • NPM Version: 6.14.4
  • webpack Version: 5.26.0
  • webpack-dev-server Version: 4.0.0-beta.2
  • Browser: Chrome
  • This is a bug
  • This is a modification request

Code

// webpack.config.js
{
  // ...
  devServer: {
    proxy: {
      '/my-path': {
        target: 'http://localhost:1234',
        logLevel: 'silent',
      },
    },
  },
}

Expected Behavior

IF any errors occur in this proxy rule (in my case they sometimes do happen, which is OK), I expect the logLevel: 'silent' to silent them. In the previous version of webpack-dev-server I used (3.11.2), this was in fact the case.

Actual Behavior

Now it ignores the logLevel: 'silent' for the proxy and logs the error:

<e> [webpack-dev-server] [HPM] Error occurred while proxying request localhost:8080/config to http://localhost:1234 [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)

The error is correct, but I want it to be silenced, as it was possible in 3.11.2.

For Bugs; How can we reproduce the behavior?

The easiest way to reproduce it, is add a proxy in the devServer section with an invalid target and set logLevel: 'silent'.

@noharashinchan
Copy link

I will try to look into it

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

Successfully merging a pull request may close this issue.

3 participants