wasm-pack
wasm-pack copied to clipboard
wasm-pack.exe build hang forever
🐛 Bug description
\wasm-game-of-life> wasm-pack.exe build --release
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
warning: function is never used: `set_panic_hook`
--> src\utils.rs:1:8
|
1 | pub fn set_panic_hook() {
| ^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: 1 warning emitted
Finished release [optimized] target(s) in 0.05s
the build command never finish
🌍 Your environment
Include the relevant details of your environment. wasm-pack version: 0.9.1
rustc version: rustc 1.46.0 (04488afe3 2020-08-24)
I also tried wasm-pack.exe build -dev
, it works as expected.
Also happened to me.
Same here, this time in WSL2 Ubuntu 20.04
. Running with --dev
works, without it, just running wasm-pack --verbose build --target nodejs
logs:
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
Finished release [optimized] target(s) in 0.02s
then hangs indefinitely without exiting and doesn't generate a package.json
file.
i think this might be due to wasm-opt, gonna tag as a wasm-opt bug, i'm working on a PR that makes wasm-opt opt-in by default. can you try to add this to your Cargo.toml
and see if it fixes your issues?
# `wasm-opt` is on by default in for the release profile, but it can be
# disabled by setting it to `false`
[package.metadata.wasm-pack.profile.release]
wasm-opt = false
@ashleygwilliams yes, it fixes my issue.
comment was a leftover from my other issue. disabling wasm-opt also helps here.
thanks @ashleygwilliams
Same problem. Hasn't it been fixed?
still having problems, even with wasm-opt disabled
I am also observing this behavior. The weird thing here, is that this only occurs when using a build script and only when trying to build a release
build. Using wasm-pack
directly in the terminal works without any problems. @ashleygwilliams Any ideas how I might debug this?
I'm not sure if this is connected, but I had this issue and then increased the disk size of my vm and that fixed the problem. Might be related to running out of disk space?
Please try out v0.12.0 from one of the following ways:
- https://github.com/rustwasm/wasm-pack/releases/tag/v0.12.0
- https://crates.io/crates/wasm-pack/0.12.0
- https://www.npmjs.com/package/wasm-pack/v/0.12.0
wasm-pack
cannot find wasm-opt
in $PATH
, so it attempts to download one.
By executing RUST_LOG=debug wasm-pack build
and strace wasm-pack build
, I discovered that wasm-pack
is attempting to download https://github.com/WebAssembly/binaryen/releases/download/version_111/binaryen-version_111-x86_64-linux.tar.gz
.
Luckily, there is apt install binaryen
, which provides wasm-opt
command. After installing it, wasm-pack
is "satisfied" and won't download anything.