sdk: Unable to load 'webpack-cli/serve' command on default app
After following the instructions for the quickstart guide of the hello app I got to this error.
$ npm start
> hello_assets@0.1.0 prestart
> npm run copy:types
> hello_assets@0.1.0 copy:types
> rsync -avr .dfx/$(echo ${DFX_NETWORK:-'**'})/canisters/** --exclude='assets/' --exclude='idl/' --exclude='*.wasm' --delete src/declarations
building file list ... done
sent 310 bytes received 20 bytes 660.00 bytes/sec
total size is 19112 speedup is 57.92
> hello_assets@0.1.0 start
> webpack serve --mode development --env development
[webpack-cli] Unable to load '@webpack-cli/serve' command
[webpack-cli] TypeError: options.forEach is not a function
It was solved by changing ‘webpack-cli’ version from “4.5.0” to “4.9.1”. Not a serious issue but might be helpful for new comers. This issue was found on MacOS with a M1 chipset.
If increasing the version doesn’t cause any issues I would gladly create a PR.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 5
- Comments: 16 (2 by maintainers)
Same issue following the quick start:
Edit: Updating webpack version to
4.10.0in thepackage.jsonand runningnpm installfixed the issue.Related issue from webpack repo: https://github.com/webpack/webpack/issues/15951
Had the same issue. apecollector’s solution worked for me. Upgraded from “4.9.1” to “webpack-cli”: “4.10.0”
Had the same issue. Similar solution worked for me. Upgraded from “4.5.0” to “webpack-cli”: “4.9.0”
Came to make this issue but you beat me to it 😃
problem solved by updating webpack-cli version to 4.10.0 in package.json
I used nvm to install node LTS cd into the project folder used command: npm install webpack-cli@4.10.0
solved the error.