book icon indicating copy to clipboard operation
book copied to clipboard

"Getting Started" step missing?

Open mvolkmann opened this issue 4 years ago • 2 comments

Where in the docs did you come across this?

Exercises at the end of section 4.2 "Hello, World!"

Describe what about it does not make sense

After making the suggested changes to src/lib.rs and www/index.js, running wasm-pack build, and refreshing the browser, I still see "Hello, hello-wasm-pack" and not the expected greeting. I tried deleting the target directory, running wasm-pack build again, and re-rerunning npm run build and npm run start, but I can't get my changes to have any effect. Is there a missing step?

Why does it not make sense?

I can't get the expected result.

How could we improve it?

Supply the missing step(s) if there are any.

mvolkmann avatar Feb 16 '21 12:02 mvolkmann

@mvolkmann , You may have missed one of the steps in this section. You likely need to:

  1. Update the package.json with a dependency pointing to the local wasm package built in ../pkg.
  2. Update the index.js file to import that package.

I missed the second step on my own first run through and it took me a while to realize the module I was importing in index.js was some module from npm and not the local package.

blazzy avatar Jan 22 '22 07:01 blazzy

I've run into the same issue. The problem was that npm install did not reinstall wasm-game-of-life package.
Solution: Delete node_modules directory, then run npm install.
Alternatively you can run npm ci, which does the same thing.

mfirgo avatar Dec 29 '22 14:12 mfirgo