Description
Where in the docs did you come across this?
Followed https://rustwasm.github.io/book/game-of-life/hello-world.html
Describe what about it does not make sense
After a first try at following the tuto and finally managed to get it working without being sure why, and finally breaking it without understanding why either, I restarted from scratch, recording step after step in this repo.
After each step that changes a file under git control I recorded things into git, with www
recorded as a submodule.
At some point, upgrading copy-webpack-plugin to v6 a breaking change pushed me to find a webpack config fix from stackoverflow, and then it worked: the web server did start without error, and my browser was able to get the demo alert.
Note that in my original attempt I did not have to look for that config fix, and had the demo working nevertheless, with some version requirements adjusted.
Now having seen previously that copy-webpack-plugin was at v11 I tried, "why not attempting to go further". As I noted in the last commit, i did not work. I tried a view versions in between, even v7 causing the same issue. So I reverted with the customary git reset --hard
, to discover that even that state was broken.
Suspecting that some state persisting beyond my sight in the gitignored dirs, I went with git clean -dxf
in both dirs, reran wasm-pack build
in topdir, npm install
in www
, just to meet the apparently permament:
user@perso-dev:www (www=)$ npm run start
> [email protected] start
> webpack-dev-server
[webpack-cli] Failed to load '/home/user/soft/rustweb/wasm-game-of-life/www/webpack.config.js' config
[webpack-cli] Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema.
- options[0] should be an object:
object { patterns, options? }
user@perso-dev:www (www=)$
Why does it not make sense?
Even taking into account that now seems to be a moving moment in npm world (but then, are there any stable ones?) , instructions have a reproducibility issue. Newcomers should be able to reach the end of the first tutorial without such problems.
How could we improve it?
Point to a public git repo where a reproducible sequence of instructions can run the project?
Give instructions to use the contents of package-lock.json
as they are (they apparently match a state that did work for someone), without npm
being allowed to change that?
Activity