I just got an unexpected failure that smells like a tool-chain issue. The error message seems to include a text dump of an entire wasm-compiled binary, so it's gigantic, and I'm not sure what is most relevant.
The command that fails is
wasm-pack build --target web
and the error looks like:
e[1me[2m[INFO]e[0m: Installing wasm-bindgen...
e[1me[2m[INFO]e[0m: Optimizing wasm binaries with `wasm-opt`...
[wasm-validator error in module] unexpected true: Exported global cannot be mutable, on
global$0
(module
(type $i32_i32_=>_none (func (param i32 i32)))
(type $i32_=>_none (func (param i32)))
(type $i32_i32_i32_=>_none (func (param i32 i32 i32)))
I've identified that the error comes from wasm-opt and I can disable running wasm-opt in my Cargo.toml, so the emergency is reduced and it looks like the bug is not in the rust tool chain itself.