wasm-bindgen: Undefined `__wbindgen_malloc` when running WASM binary
Describe the Bug
We’ve recently hit a snag from compiling the same code and getting different results a few weeks apart.
2 weeks ago, we published this bundle: https://unpkg.com/browse//bitmask-core@0.5.0-rc.6/
It was built from this repo and commit: https://github.com/diba-io/bitmask-core/commit/5cf7f4d64354e4979b9d5d74c8c83871f1627e83
Using this command: wasm-pack build --release --target bundler
Back then, it produced a binary that runs in our Chrome extension, but now it produces something different, where running any function results in this error:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '__wbindgen_malloc')
I’m not sure what steps I can try to investigate this further.
Examples of more recent tries:
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 35 (5 by maintainers)
I don’t think there is an init function when using bundler, only when targeting web
So either you have (with
wasm-pack build --target web):Or (with
wasm-pack build --target bundler):Edit: Here is an example with
--target web: wasm.htmlI don’t know sorry 😕
I have these options set using
5.75.0My development branch has been offline for 2 weeks, I thought I had just misconfigured the webserver somehow.