Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name doesn't appear in the alert from hello world exercise #163

Closed
jimmycuadra opened this issue Apr 11, 2019 · 4 comments
Closed

Name doesn't appear in the alert from hello world exercise #163

jimmycuadra opened this issue Apr 11, 2019 · 4 comments

Comments

@jimmycuadra
Copy link

Describe the bug
I'm going through the tutorial and just came to the end of the "hello world" page. At the bottom there is an "exercises" section that asks you to modify the greet function to take a name. When running the code exactly as shown, the browser alert does not include the name passed to the function. It simply displays Hello, !. I made sure that my code is identical to what is shown in the answer section, re-ran wasm-pack build from the root of the project, and even restarted the webpack development server just to be sure. Same result.

To Reproduce
Steps to reproduce the behavior:

  1. Follow the hello world tutorial exactly.

Expected behavior
The alert should say Hello, Your Name!.

Additional context
Software used:
rustc 1.35.0-nightly (3750348da 2019-04-08)
wasm-bindgen 0.2.41
npm 6.9.0
Firefox 66.0.2

@mddizon
Copy link

mddizon commented Apr 11, 2019

Hi Friend,
I ran into the same problem. It looks like there might be an issue with the latest version of wasm-bindgen.
In the meantime I removed the Cargo.lock file, then downgraded and forced the the version in Cargo.toml from wasm-bindgen = "0.2" to wasm-bindgen = "=0.2.40".
Hope this helps!

@jimmycuadra
Copy link
Author

I wonder if it would make sense to add some regression testing to the book's examples. Having a hello world example at the very beginning of a tutorial fail is not a good first impression for users. I realize this whole thing is super new so we shouldn't expect things to be nice and polished at this point, though. Just thinking out loud.

@alexcrichton
Copy link
Contributor

I suspect that this is rustwasm/wasm-bindgen#1436 if 0.2.40 works and 0.2.41 doesn't. That just means it's basically a 17-hour-old regression (and this issue is 13 hours old!) so we should have this fixed soon :)

@alexcrichton
Copy link
Contributor

Closing now that the fix had landed and I'll publish a new version soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants