webpack-dev-server: Error: Cannot find module 'webpack-cli/bin/config-yargs' when use v5
webpack-cli/bin/
no longer exists as of (https://github.com/webpack/webpack-cli/commit/82407e5e1fee2ce7e8dd4cfa9596b99ed0cde4fc). This is a blocker for at least webpack-cli@4.0.0-alpha-5
. Is there a workaround…?
_Originally posted by @JoshuaKGoldberg in https://github.com/webpack/webpack-dev-server/issues/2239#issuecomment-539163568_
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 18
- Comments: 69 (22 by maintainers)
Commits related to this issue
- Add webpack serve (npm install --save-dev @webpack-cli/serve@beta) - see https://github.com/webpack/webpack-dev-server/issues/2424#issuecomment-659982961 — committed to devzendo/rotortastic by devzendo 4 years ago
- Replace `webpack-dev-server` with `webpack serve` command. https://github.com/webpack/webpack-dev-server/issues/2424 — committed to JustArchiNET/ASF-ui by Aareksio 4 years ago
- Replace `webpack-dev-server` with `webpack serve` command. (#1154) https://github.com/webpack/webpack-dev-server/issues/2424 — committed to JustArchiNET/ASF-ui by Aareksio 4 years ago
- webpack serve https://github.com/webpack/webpack-dev-server/issues/2424 — committed to pione30/twitter2 by pione30 4 years ago
- build(examples): correctly start webpack (#213) As suggested: https://github.com/webpack/webpack-dev-server/issues/2424#issuecomment-581319104 — committed to onfido/castor by josokinas 3 years ago
- newest versions of installs (except for webpack-cli, which is 3.3.11 to resolve https://github.com/webpack/webpack-dev-server/issues/2424) — committed to RiseWith/Adminator-admin-dashboard by RiseWith 3 years ago
- Use webpack serve instead of webpack-dev-server Following suggestions from thread on github: https://github.com/webpack/webpack-dev-server/issues/2424 — committed to ZzAve/teambalance by ZzAve 3 years ago
- chore(deps-dev): migrate webpack-dev-server from v3 to v4 webpack-cli@4 requires webpack-dev-server@4: https://github.com/webpack/webpack-dev-server/releases/tag/v4.0.0-beta.0 * Migrate config from ... — committed to ccns/PttChrome by IepIweidieng 3 years ago
- chore(deps-dev): migrate webpack-dev-server from v3 to v4 webpack-cli@4 requires webpack-dev-server@4: https://github.com/webpack/webpack-dev-server/releases/tag/v4.0.0-beta.0 * Migrate config from ... — committed to ccns/PttChrome by IepIweidieng 3 years ago
- chore(deps-dev): migrate webpack-dev-server from v3 to v4 webpack-cli@4 requires webpack-dev-server@4: https://github.com/webpack/webpack-dev-server/releases/tag/v4.0.0-beta.0 * Migrate config from ... — committed to ccns/PttChrome by IepIweidieng 3 years ago
- chore(deps-dev): migrate webpack-dev-server from v3 to v4 webpack-cli@4 requires webpack-dev-server@4: https://github.com/webpack/webpack-dev-server/releases/tag/v4.0.0-beta.0 * Migrate config from ... — committed to ccns/PttChrome by IepIweidieng 3 years ago
- chore(deps-dev): migrate webpack-dev-server from v3 to v4 webpack-cli@4 requires webpack-dev-server@4: https://github.com/webpack/webpack-dev-server/releases/tag/v4.0.0-beta.0 * Migrate config from ... — committed to ccns/PttChrome by IepIweidieng 3 years ago
- make watch-admin fails with: Cannot find module 'webpack-cli/bin/config-yargs' Can't run make watch-admin in Dockware as it stops with the following error: Error: Cannot find module 'webpack-cli/... — committed to markus-perl/administration by markus-perl 2 years ago
You need to use
webpack serve
Yes, please use
webpack serve
for4
version to run webpack dev server, we will remove own binaries in next version, feel free to leave feedback if something doesn’t workCould someone explain what “webpack serve” is actually doing as a command, as opposed to “webpack-dev-server”? It might help people understand why they now have to do this.
Is it running the “webpack-serve” server instead of the “webpack-dev-server” one? (if so, how does it work without that dependency being installed?)
I found plenty of reports saying webpack-dev-server is only in maintenance and that people should use webpack-serve instead, but that doesn’t seem to be the case here as web-pack-dev server now appears to have a major new version in beta?
This is all quite confusing for people I think! 😦
Please use
webpack serve
instead of usingwebpack-dev-server
inpackage.json
, it was answered a lot of time, but because each every time no wants to read but just writes, the answer constantly disappearsI don’t know if you are the same team that maintains webpack-dev-server but wouldn’t be cool if there is a post or article exposing this change? From my point of view this is some kind of breaking change… Don’t you agree? Maybe a commentary on the changelog should be enough.
This seems like a lot of hoops to jump through compared to just doing
webpack-dev-server
which used to work@evilebottnawi thank you. This really needs to be mentioned in the migrate to webpack 5 doc that is out there
@bahtou fixed in webpack-cli, release will be today/tomorrow, feel free to feedback after new release
Hello 👋. To fix it just do 2 things.
done!
If I use “webpack serve” instead of “webpack-dev-server” then my “–config” file option is being ignored. What is the equivalent for providing the config file?
perfect
So is
webpack-dev-server
not needed when using webpack 5?Will
webpack serve
support eventually the same cli options that webpack-dev-server currently does?it works succesfully
webpack 5.0.0 compiled successfully in 430 ms
"dev": "webpack serve"
Thanks !! @evilebottnawi
@evilebottnawi is this a temporary solution and if not could you give me an example of how to live-reload on change with the webpack serve
webpack serve
,but it didn’t work. This is my package dependencies:Fixed in
webpack-dev-server@4-beta.0
@evilebottnawi I think the issue is we do not get the same functionality with just using
webpack serve
and there doesn’t seem to be any explanation with how to get it working in the same way. Are you going to provide some official documentation of these changes?I’m also having the same problems as @Suwings where my config file doesn’t get looked at when using webpack serve . Has anyone found a solution yet?
How was my comment spam? how rude. 👎 This thread has an answer that doesn’t correspond to the docs. The
webpack serve
command doesn’t come up when searching the docs of Webpack 4/5.Why would this be marked as spam. This is actually the solution for right now until a better one presents itself. It seems like someone is trying to force a new version before support has caught up
In
v5.1.3
, it can be started by using thewebpack serve
command, but it still requireswebpack-dev-server
dependency.It has been put into use without any problems.
https://github.com/webpack/webpack-cli/issues/1948 and please use emoji, no need to spam, otherwise other developers won’t be able to find the answer
https://github.com/webpack/webpack-dev-server/issues/2770#issuecomment-709209686
I wrote a comment in this issue. I don’t think this behavior will load the webpack config. wrong?
Thanks. For such a mainstream tool, it should be in the docs.
@galbeiroc Do you read my answer? Please use
webpack serve
to run webpack dev serverany update on this.
@evilebottnawi That specific issue was fixed in https://github.com/webpack/webpack-cli/pull/1376 5 months ago, but it hasn’t been released yet. And yes, that’s a Yarn PnP error message
OK,I will.
It didn’t work for me until I specified the ‘contentBase’ and ‘port’ property of the devServer and ran the command ‘webpack serve --config ./webpack.config.js’
SOLUTION - https://github.com/webpack/webpack-cli/issues/1948#issuecomment-708939567
In my case the solution was just use previous versions -
@infime we consider this, thanks for feedback
@evilebottnawi I was using
overlay
,https
andcert
/key
in several different invocations for different scenarios. Lettingwebpack serve --help
show the available options would be helpful as well.@bahtou please create reproducible test repo and open an issue in webpack-cli, thanks!
@evilebottnawi Just reporting results: It works! Thank you!