xuu / wasm-tetris Goto Github PK
View Code? Open in Web Editor NEWWasm Tetris
Home Page: https://xuu.github.io/wasm-tetris/
License: MIT License
Wasm Tetris
Home Page: https://xuu.github.io/wasm-tetris/
License: MIT License
After a fresh git clone
, following the steps in README.md
(including my pull request for including installing wasm-bindgen-cli
), the build.sh
script still fails:
$ ./build.sh
+ cargo build --target wasm32-unknown-unknown
Finished dev [unoptimized + debuginfo] target(s) in 14.10s
+ wasm-bindgen ./target/wasm32-unknown-unknown/debug/wasm_tetris.wasm --out-dir ./wasm
error: failed to write `./wasm/wasm_tetris.js`
caused by: No such file or directory (os error 2)
mkdir wasm
fixes this. Should probably be part of build.sh
?
It seems that, building the project using the current version of wasm-bindgen
is not permitted:
+ cargo build --target wasm32-unknown-unknown
Finished dev [unoptimized + debuginfo] target(s) in 0.47s
+ mkdir -p wasm
+ wasm-bindgen ./target/wasm32-unknown-unknown/debug/wasm_tetris.wasm --out-dir ./wasm
error: failed to extract wasm-bindgen custom sections
caused by:
it looks like the Rust project used to create this wasm file was linked against
a different version of wasm-bindgen than this binary:
rust wasm file: 0.2.29
this binary: 0.2.37
Currently the bindgen format is unstable enough that these two version must
exactly match, so it's required that these two version are kept in sync by
either updating the wasm-bindgen dependency or this binary. You should be able
to update the wasm-bindgen dependency with:
cargo update -p wasm-bindgen
or you can update the binary with
cargo install -f wasm-bindgen-cli
if this warning fails to go away though and you're not sure what to do feel free
to open an issue at https://github.com/rustwasm/wasm-bindgen/issues!
Attempt to solve the issue
In order to solve this issue, we need to explicit that the supported version of wasm-bindgen-cli
is the 0.2.29 version, replacing (in the README file):
cargo install wasm-bindgen-cli
by
cargo install wasm-bindgen-cli --version 0.2.29
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.