rustwasm / book

The Rust and WebAssembly Book
https://rustwasm.github.io/docs/book/
MIT License
1.73k stars 208 forks source link

Hello World example fails to npm run start #173

Closed BartMassey closed 5 years ago

BartMassey commented 5 years ago

Where in the docs did you come across this?

Hello World! tutorial page.

Describe what about it does not make sense

Disclaimer: I am not an NPM person.

I followed the instructions carefully to try to get the app running. When I got to

npm run start

I got some log messages and then

ERROR in ./index.js
Module not found: Error: Can't resolve 'wasm-game-of-life' in '/home/bart/prj/rust/wasm-game-of-life/www'
 @ ./index.js 1:0-42 3:0-10
 @ ./bootstrap.js
ℹ 「wdm」: Failed to compile.

Came back to it a few days later, found that package-lock.json had the wrong module in it. Removed package-lock.json, ran npm init again, and was good to go.

Why does it not make sense?

Didn't know what was going on without some serious reflection because the instructions didn't quite work.

How could we improve it?

Add an instruction to run npm init again after editing package.json. (I think that's sufficient?)

fitzgen commented 5 years ago

Thanks for filing an issue! I believe this was fixed by https://github.com/rustwasm/book/pull/171 -- if not, please reopen this issue :)

BartMassey commented 5 years ago

Sorry I missed issue #171 when filing mine. (I did look, honest :-) ). Thanks for the fix!