Closed ice-cream-coder closed 6 years ago
I'm also receiving the same errors when trying to follow the tutorial. Running on macOS. Happy to provide any other helpful information.
The root of the issue Unexpected valtype: 0x61
comes from https://github.com/xtuc/webassemblyjs, the other errors are from Webpack because we failed to "prepare" the wasm binary.
(I just need to catch my flight and i'll investigate that).
@roydaw could you please send me the repo the tutorial points to? or the tutorial?
@xtuc https://github.com/rustwasm/wasm_game_of_life
But I don't know which chapter has the bug.
I can't reproduce the issue, every chapter of the wasm_game_of_life
works for me.
I tried to start the tutorial again and got hung up at a different point. I'm trying to follow this page https://rustwasm.github.io/book/game-of-life/setup.html
This time I wasn't able to build the project with npm run build-debug
. I get this error:
error[E0658]: attribute procedural macros are experimental (see issue #38356)6
--> src/lib.rs:7:1
|
5 | use wasm_bindgen::prelude::*;
| ------------------------ procedural macro imported here
6 |
7 | #[wasm_bindgen]
| ^^^^^^^^^^^^^^^
|
= help: add #![feature(proc_macro)] to the crate attributes to enable
I checked my lib.rs
file and I do have this line:
#![feature(proc_macro, wasm_custom_section, wasm_import_module)]
So I have no idea why it would do that. (Using Linux, tried npm 5.5.1 and 5.6.0)
Oh shoot, good catch! I think that proc_macro
needs to be replaced with use_extern_macros
. Not positive that applies here as well, but I ran into a similar issue recently!
@roydaw ah for that @data-pup is correct, and I've submitted an update to the tutorial at https://github.com/rustwasm/book/pull/48
Awesome, I past npm run build-debug
now I'm back to my orignal issue.
(Also, someone could look into fixing the compiler error message since it suggested to add proc_macro
instead of use_extern_macros
.)
@roydaw have you tried updating your NPM dependencies? This may be a fixed bug in webpack perhaps? The compiler suggestion should be fixed in https://github.com/rust-lang/rust/pull/52458
Okay! I ran npm update
, and that seemed to fix the issue.
Ok great! In that case sounds like this is fixed now, so closing
same error here, even after execute npm update.
After running
npm run serve
I get this error:I inspected my wasm_game_of_lif_bg.wasm and found that all functions were defined.
__wbindgen_malloc
,greet
, and__wbindgen_free
.