Skip to content

wasm-pack build fails #58

@szunami

Description

@szunami

Describe the Bug

I hit what I believe is drager/wasm-pack#886 while working through the Game of Life tutorial. I have pushed my current code state here:

szunami/hello_rust_wasm@50ab356

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:
drager/wasm-pack#886 (comment)
and
drager/wasm-pack#886 (comment)
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions