redwood: fresh install bug - Unable to load '@webpack-cli/serve' command

Hi There,

I have just done a fresh install of 0.37.2 and when I try running yarn rw dev I get errors in my terminal and can not get a page to open.

% yarn rw dev 
yarn run v1.22.15
$ /Users/shannonsmith/Documents/GitHub/bedhopper/node_modules/.bin/rw dev
$ /Users/shannonsmith/Documents/GitHub/bedhopper/node_modules/.bin/cross-env NODE_ENV=development RWJS_WATCH_NODE_MODULES= webpack serve --config /Users/shannonsmith/Documents/GitHub/bedhopper/node_modules/@redwoodjs/core/config/webpack.development.js
$ /Users/shannonsmith/Documents/GitHub/bedhopper/node_modules/.bin/cross-env NODE_ENV=development NODE_OPTIONS=--enable-source-maps yarn nodemon --watch /Users/shannonsmith/Documents/GitHub/bedhopper/redwood.toml --exec 'yarn rw-api-server-watch'
$ /Users/shannonsmith/Documents/GitHub/bedhopper/node_modules/.bin/rw-gen-watch
web | [webpack-cli] Unable to load '@webpack-cli/serve' command
web | [webpack-cli] TypeError: options.forEach is not a function
web |     at WebpackCLI.makeCommand (/Users/shannonsmith/Documents/GitHub/bedhopper/node_modules/webpack-cli/lib/webpack-cli.js:173:21)
web |     at ServeCommand.apply (/Users/shannonsmith/Documents/GitHub/bedhopper/node_modules/@webpack-cli/serve/lib/index.js:41:19)
web |     at loadCommandByName (/Users/shannonsmith/Documents/GitHub/bedhopper/node_modules/webpack-cli/lib/webpack-cli.js:907:35)
web |     at async Command.<anonymous> (/Users/shannonsmith/Documents/GitHub/bedhopper/node_modules/webpack-cli/lib/webpack-cli.js:1483:17)
web |     at async Promise.all (index 0)
web |     at async WebpackCLI.run (/Users/shannonsmith/Documents/GitHub/bedhopper/node_modules/webpack-cli/lib/webpack-cli.js:1521:9)
web |     at async runCLI (/Users/shannonsmith/Documents/GitHub/bedhopper/node_modules/webpack-cli/lib/bootstrap.js:11:9)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
web | cd "/Users/shannonsmith/Documents/GitHub/bedhopper/web" && yarn cross-env NODE_ENV=development RWJS_WATCH_NODE_MODULES= webpack serve --config "/Users/shannonsmith/Documents/GitHub/bedhopper/node_modules/@redwoodjs/core/config/webpack.development.js"  exited with code 2

...... API seems to generate okay.

System details below.

  System:
    OS: macOS 11.5.2
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.6 - /var/folders/t3/gmgw2_c966sdwbh8whw_0cx00000gn/T/yarn--1633569109564-0.34389710180327326/node
    Yarn: 1.22.15 - /var/folders/t3/gmgw2_c966sdwbh8whw_0cx00000gn/T/yarn--1633569109564-0.34389710180327326/yarn
  Databases:
    SQLite: 3.32.3 - /usr/bin/sqlite3
  Browsers:
    Chrome: 94.0.4606.71
    Safari: 14.1.2
  npmPackages:
    @redwoodjs/core: 0.37.2 => 0.37.2 

Can I get a hand please?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (16 by maintainers)

Most upvoted comments

v0.37.3 will be out within the hour

Thank you to you and @jacebenson for reporting this.

The dependency of my dependency is my enemy…

…or so the saying goes.

Hi @Isaac-Tait So you cloned https://github.com/redwoodjs/example-blog?

Most likely what happened is that the yarn.lock updated (or was generated from scratch), and then included @webpack-cli/serve@1.6.0 in the yarn.lock. We did not add these patch changes (ie code mod to package.json to the Example Blog: https://github.com/redwoodjs/redwood/releases/tag/v0.37.3

One quick fix is to search in your yarn.lock and remove the instance of @webpack-cli/serve@1.6.0, fixing it to v1.5.2 instead.

What a mess, regardless. I’m still working with the webpack-cli maintainer to get out a patch… 😦

Ah, got it thanks @jtoar

It’ll be an rc tag, which you can test with yarn rw upgrade -t rc. But no worries about that. Just keep a lookout for Redwood release patch!

@Isaac-Tait it looks like there’s a fix and it’s now in Redwood main branch. Going to test it this afternoon and, give success, release v0.37.5 patch.

So you cloned https://github.com/redwoodjs/example-blog?

Yes that is correct.

Thank you for the workaround - I will implement it 👍🏼 😄 Fingers crossed the webpack folks get a patch release ASAP 🤞🏼

Trying this in my root package.json to see if it resolves: Maybe just try to add the dependencies manually:

// ./package.json
...
  "devDependencies": {
    "@redwoodjs/core": "^0.37.2",
    "webpack": "5.57.1",
    "webpack-dev-server": "4.3.1",
    "webpack-cli": "4.9.0"
  },
...