Skip to content
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

[Rails 5.2.0.rc1 / Webpack] fresh app, webpack-dev-server fails to start #1338

Closed
rafaelfranca opened this issue Mar 12, 2018 · 1 comment
Closed

Comments

@rafaelfranca
Copy link
Member

From @hansondr on March 12, 2018 22:5

Steps to reproduce

Create a new 5.2.0.rc1 application with webpack enabled:
rails _5.2.0.rc1_ new webpack_test --webpack

Attempt to start the webpack-dev-server:
cd webpack_test
bin/webpack-dev-server

Expected behavior

webpack-dev-server starts up

Actual behavior

Errors out with the following:

The CLI moved into a separate package: webpack-cli.
Please install 'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D
module.js:549
    throw err;
    ^

Error: Cannot find module 'webpack-cli/bin/config-yargs'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/drh/src/webpack_test/node_modules/webpack-dev-server/bin/webpack-dev-server.js:65:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

System configuration

Rails version: 5.2.0.rc1

Ruby version: 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]

Temporary Solution

By manually editing the webpack-dev-server entry within package.json to target versions less than 3.0 e.g.

{
  "name": "webpack_test",
  "private": true,
  "dependencies": {
    "@rails/webpacker": "^3.3.0"
  },
  "devDependencies": {
    "webpack-dev-server": "<3.0.0"
  }
}

Copied from original issue: rails/rails#32232

@gauravtiwari
Copy link
Member

Thanks @rafaelfranca. Published a new patch version that fixes the issue.

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

No branches or pull requests

2 participants