wasm-pack-template icon indicating copy to clipboard operation
wasm-pack-template copied to clipboard

wasm-pack build fails

Open szunami opened this issue 4 years ago • 2 comments

Describe the Bug

I hit what I believe is https://github.com/rustwasm/wasm-pack/issues/886 while working through the Game of Life tutorial. I have pushed my current code state here:

https://github.com/szunami/hello_rust_wasm/commit/50ab3561207a5ce18a86819393b76284c1ca8e40

I am on cargo 1.47.0 (f3c7e066a 2020-08-28), npm 6.4.1, hapy to offer other version as appropriate.

Steps to Reproduce

check out ^ and run wasm-pack build. On my machine I get a very verbose error that includes [wasm-validator error in module] unexpected true: Exported global cannot be mutable, on global$0.

Notably, running wasm-pack build --dev succeeds.

Expected Behavior

The build should succeed.

Actual Behavior

The build fails.

Additional Context

There are two solutions mentioned in the bug thread: https://github.com/rustwasm/wasm-pack/issues/886#issuecomment-666309982 and https://github.com/rustwasm/wasm-pack/issues/886#issuecomment-667669802 I think it would be appropriate if one of these solutions came pre-baked into this repository. I am happy to contribute either change.

I recognize that there are some rough edges with respect to WASM, but I think it would be nice if the "hello world" project succeeded consistently. If the solutions in the thread are inappropriate for general adoption, perhaps a new template could be spun up which is more consistent?

szunami avatar Dec 02 '20 20:12 szunami

There is a PR proposed for this (#52), I don't if there's a reason it has not been merged. Encountered the same problem following the tutorial.

nguiard avatar Dec 25 '20 20:12 nguiard

I assume it is just busy people doing their best :)

szunami avatar Dec 25 '20 21:12 szunami