Open undavide opened 1 year ago
I've found a crucial bit of information in this page from the wasm-pack
docs:
Go into the package.json file, add your package, and remove the hello-wasm-pack dependency from the "dependencies" section.
I've then deleted the entire node_modules
folder and run npm install
once more. I'd suggest to add it to the documentation.
Thanks!
Describe the bug Following the 4.2 exercise solution at the bottom of the page, the
greet()
keeps alertingHello, wasm-game-of-life!
instead ofHello, Davide!
.To Reproduce I've followed the tutorial I believe to the letter. To solve the final exercise, I've implemented
wasm-game-of-life/src/lib.rs
as:Also
wasm-game-of-life/www/index.js
now contains:I've then run
wasm-pack build
to rebuild the wasm package, and to be 100% sure, I've closed and re-opened the local server vianpm run start
.Expected behavior
http://localhost:8080
should pop up an alert sayingHello, Davide!
, instead it keeps sayingHello, wasm-game-of-life!
I've made sure that
package.json
contains the"dependencies": { "wasm-game-of-life": "file:../pkg" },
andnpm install
has run thereafter.Additional context rustc 1.66.0, wasm-bindgen 0.2.63.
Thank you!