Skip to content

Incorrect warning about watch command #3778

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
MoritzLost opened this issue May 8, 2023 · 4 comments · Fixed by #3783
Closed

Incorrect warning about watch command #3778

MoritzLost opened this issue May 8, 2023 · 4 comments · Fixed by #3783
Labels

Comments

@MoritzLost
Copy link

MoritzLost commented May 8, 2023

Describe the bug

After updating to 5.1.0, I'm getting the following warning when I run npm run start:

[webpack-cli] No need to use the 'watch' command together with '{ watch: true | false }' or '--watch'/'--no-watch' configuration, it does not make sense.

However, this warning doesn't make sense – we're not using the watch command.

The start command runs this command: webpack --watch --config webpack.development.js

It only uses --watch, not watch, and our webpack config doesn't include a watch option. Switching --watch to watch makes the error go away.

What is the current behavior?

The warning above is displayed even when it shouldn't be, based on the command used.

To Reproduce

Not sure – running the command above results in this error. This warning didn't show up in 5.0.1 (same configuration and command), so it has to have been introduced in 5.0.2 or 5.1.0.

Expected behavior

The warning above should only be output if the watch command is actually used.

Additional context

npm webpack-cli info

  System:
    OS: macOS 13.3.1
    CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
    Memory: 128.16 MB / 16.00 GB
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.15.0/bin/yarn
    npm: 9.6.4 - ~/.nvm/versions/node/v18.15.0/bin/npm
  Browsers:
    Chrome: 113.0.5672.63
    Firefox: 112.0.2
    Firefox Developer Edition: 113.0
    Safari: 16.4
  Packages:
    babel-loader: ^9.1.2 => 9.1.2 
    clean-webpack-plugin: * => 4.0.0 
    compression-webpack-plugin: ^10.0.0 => 10.0.0 
    copy-webpack-plugin: ^11.0.0 => 11.0.0 
    css-loader: ^6.7.3 => 6.7.3 
    postcss-loader: ^7.3.0 => 7.3.0 
    sass-loader: ^13.2.2 => 13.2.2 
    webpack: ^5.82.0 => 5.82.0 
    webpack-cli: ^5.1.0 => 5.1.0 
    webpack-manifest-plugin: ^5.0.0 => 5.0.0 
    webpack-merge: ^5.8.0 => 5.8.0 
    webpack-remove-empty-scripts: ^1.0.3 => 1.0.3 
@MoritzLost MoritzLost added the Bug label May 8, 2023
@alexander-akait
Copy link
Member

alexander-akait commented May 9, 2023

It means you use webpack serve or webpack watch and has watch: true | false

@alexander-akait
Copy link
Member

But I see a problem

@alexander-akait
Copy link
Member

Please update to https://github.com/webpack/webpack-cli/releases/tag/webpack-cli%405.1.1

@MoritzLost
Copy link
Author

@alexander-akait Looks like that fix worked, not getting the error in 5.1.1 any more. Thanks!

silverwind added a commit to go-gitea/gitea that referenced this issue May 12, 2023
- Update all JS dependencies
- Tested citation and various vue components

Also this includes the fix for
webpack/webpack-cli#3778.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants