This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
TypeError: wasm is undefined
when package name is not wasm
and using a bundler
#3560
Labels
Describe the Bug
When running some functions that I have exported from Rust, I get
TypeError: wasm is undefined
. I noticed that this error gets thrown from inside thegetUint8Memory0
function, so only functions that need it throw this error.I also noticed that my Wasm package wasn't called
wasm
, and wasn't atnode_modules/wasm
. Renaming it back towasm
fixed everything.Steps to Reproduce
See lafkpages/wasm-bindgen-error-repro.
This is a simple example that uses SvelteKit and Vite for a bundler, and produces the error described above (tested on Firefox 116). If you
git reset --hard
the latest commit in the repo, everything works fine.Expected Behavior
I should be able to name my package whatever I want with no problems.
Actual Behavior
I can only call the package
wasm
or I get the above errors.Additional Context
All above ^^
The text was updated successfully, but these errors were encountered: