Skip to content

Webpack dev server doesn't work anymore #18

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
nukerr opened this issue Jan 19, 2021 · 5 comments · Fixed by #30
Closed

Webpack dev server doesn't work anymore #18

nukerr opened this issue Jan 19, 2021 · 5 comments · Fixed by #30

Comments

@nukerr
Copy link

nukerr commented Jan 19, 2021

After following the installation steps, I cannot start webpack-dev-server anymore.
here's the stacktrace:

./bin/webpack-dev-server
internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'webpack-cli/bin/config-yargs'
Require stack:
- /project/node_modules/webpack-dev-server/bin/webpack-dev-server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/project/node_modules/webpack-dev-server/bin/webpack-dev-server.js:65:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/project/node_modules/webpack-dev-server/bin/webpack-dev-server.js'
  ]
}
@vovimayhem
Copy link

I'm replicating the error on a "fresh" Rails 6.1.1 app. The webpack-cli version installed is 3.3.12.

Something during ./bin/rails tailwindcss:install command is updating the webpack-cli npm package to version 4.4.0, which no longer has the webpack-cli/bin/config-yargs path (in the node_modules folder)

@vovimayhem
Copy link

vovimayhem commented Jan 20, 2021

That would be the special version of rails/webpacker that's being used for this package requiring a version of wepack-cli greater than 4.0.0. Looks like 4.4.0 doesn't have that configuration in any of the expected paths.

@miharekar
Copy link

Hey, @BakiVernes, sorry to ping you directly, but you selected that specific commit for LATEST_WEBPACKER so maybe you have some ideas how to fix this? 😅

@CuriousPhysicist
Copy link

So I hit this problem this morning and like @vovimayhem I'm on Rails 6.1.1.

The webpack-dev-server was running fine until I ran the tailwindcss:install rake task.

A fix which seems to have worked for me (but definitely is a sticking plaster approach) is to run:

yarn install [email protected]

I don't know enough about why it broke to know why this fixed it for me 🤷

If it helps anyone else in the while a fix is worked on then great. :-)

My setup is Macbook on Catelina 10.15.7 (19H114), Ruby - ruby 2.7.2p137 (2020-10-01 revision 5445e04352)

@BakiVernes
Copy link
Contributor

Working on a fix!

thealiilman added a commit to thealiilman/unm-competition-info that referenced this issue Feb 2, 2021
bin/webpack-dev-server doesn't work without this addition.

Here's the relevant GitHub issue.
rails/tailwindcss-rails#18
@dhh dhh closed this as completed in #30 Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants