book icon indicating copy to clipboard operation
book copied to clipboard

Answer in 4.2 exercise does not work.

Open letto4135 opened this issue 3 years ago • 1 comments

Describe the bug Everything seems to be working as expected until I get to the exercise. Updating the code and running wasm-pack build does nothing to the front end.

To Reproduce Steps to reproduce the behavior: Follow instructions up to the exercise in 4.2

Expected behavior The exercise should work.

Screenshots Screen Shot 2021-09-28 at 8 39 28 PM Screen Shot 2021-09-28 at 8 39 46 PM Screen Shot 2021-09-28 at 8 40 21 PM

letto4135 avatar Sep 29 '21 00:09 letto4135

I get the same behavior image image image

joshuaalm avatar Nov 19 '21 14:11 joshuaalm

The reason is because npm install already captured the old version of wasm-game-of-life. To fix this:

  1. Up-version in the Cargo.toml, e.g. "0.1.1"
  2. Within the wasm-game-of-life directory run wasm-pack build
  3. Within the www directory run npm install wasm-game-of-life
  4. You might also need to stop and restart the local server

image

armenic avatar Nov 11 '22 00:11 armenic

I have a similar problem. Only the result of the first compilation is ever used. Any changes after compiling the first time have no effect. I have tried changing the version in the cargo.toml + restarted the server + uninstall wasm-game-of-life and readded in to the dependencies section + removed the www app and recreated it. None of these steps help :(

The only way I have found to get around the problem is to remove the entire wasm-game-of-life folder and recreating it + applying all the changes to the code before running wasm-pack build

Note this is the case for the steps in the subsection "Implementing Life" as well

erikbrntsn avatar Nov 22 '22 10:11 erikbrntsn

Sorry, I'm just going to close this. I can't remember at this point if I ever got it to work, and I don't have anything set up to know whether armenics answer works.

letto4135 avatar Nov 23 '22 04:11 letto4135

@armenic 's answer worked for me. I know this issue has been closed but it doesn't appear the instructions for the tutorial have been corrected (in fact, it doesn't seem like there is much activity towards maintaining this book unfortunately--lots of accumulated issues and pull requests that are unattended).

ptdecker avatar Feb 06 '23 23:02 ptdecker