Menci / Menci/vite-plugin-wasm
Wasm initialization missing using `npm run build`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 431
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
I used this plugin to import the @dimforge/rapier3d physics engine, which uses WebAssembly internally. Everything works as expected when I run npm run dev. However, npm run build produces a dist/ directory with a .wasm file but no WebAssembly.instantiate*() of any kind in the .js file(s). As a result, an error is emitted the first time the nonexistent WebAssembly instance is accessed.
Here is a reproducible example: https://github.com/finnbear/vite-plugin-wasm-bug
Thanks for making this plugin!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproducible example linked in the issue and compare the npm run dev and npm run build outputs. Inspect the generated dist/ JavaScript and .wasm files, then trace the plugin's build path to find where WebAssembly initialization is omitted. Done means the built output initializes the module and the runtime access no longer errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, wasm
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100