-
Notifications
You must be signed in to change notification settings - Fork 409
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
build failed when converting .rs to .wasm #900
Comments
+1 here. Also very new to Rust/WASM. I was able to track down the error as coming from the
function and the compilation error returned. If you remove the |
Problably related to rustwasm/wasm-bindgen#2279 |
@SimonWang9610 you should be able to run |
Yeah, I tried your method. The compile process is passed, but the program did not work as expected. Like you said, probably because the returned value is |
@SimonWang9610 It should work if compiled successfully. It works for me, at least. What are you seeing? |
@fermezz but actually no. If I comment So i am pretty sure there are some problems related to convert |
@SimonWang9610 oh, yeah, totally. I meant that if you leave the render function untouched but downgrade the version for wasm-pack to 0.8.1 (instead of 0.9.1) you can compile successfully and have it working as expected. |
This is probably the same issue as #886. A workaround is mentioned in #886 (comment). |
closing as duplicate |
🐛 Bug description
When I followed the official document
Rust and WebAssembly
and coded the exampleConway's Game of Life
, I failed to runwasm-pack build
. Error Message as below:Fatal: error in validating input
Error: failed to execute ``wasm-opt``: exited with exit code: 1
full command: "C:\\Users\\Simon\\AppData\\Local\\.wasm-pack\\wasm-opt-171374efd61df962\\wasm-opt.exe" "C:\\projects\\learn-rust\\wasm-game-of-life\\pkg\\wasm_game_of_life_bg.wasm" "-o" "C:\\projects\\learn-rust\\wasm-game-of-life\\pkg\\wasm_game_of_life_bg.wasm-opt.wasm" "-O" To disable ``wasm-opt``, add ``wasm-opt = false`` to your package metadata in your ``Cargo.toml
.`Even though I disabled
wasm-opt = false
, the compiled process was passed but it failed to work with the glue code. I mean, runnpm run start
it did not work as expected.the Rust code is the same as the example in the Doc
Rust and WebAssembly
.🤔 Expected Behavior
I want to know it is a bug? or something wrong I did?
I am totally a beginner on Rust & WebAssembly, hope you guys can help me.
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version:
wasm-pack 0.9.1
rustc version:
rustc 1.45.0 (5c1f21c3b 2020-07-13)
wee_alloc
version:0.4.5
wasm-bindgen
version:0.2.63
opt-level
:'s'
Platform:
Windows 10
IDE:
VS code
The text was updated successfully, but these errors were encountered: