parseVec could not cast the value
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version
0.14.2
If you cannot get Bevy to build or run on your machine, please include:
- the Rust version you're using (you can get this by running `cargo --version`)
1.82.0
- Relevant system information
Mac m1, macOS 14.6.1
## What you did
Building WASM with (see instructions in readme):
https://github.com/ivnsch/mol/tree/wasm_debug_removing_things
Use it in a next app:
https://github.com/ivnsch/mol_next_app_tmp
(start with `npm run dev`, navigate to http://locahost:3000)
## What went wrong
Error:
⨯ ./wasm/mol_bg.wasm
Module parse failed: Internal failure: parseVec could not cast the value
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
Error: Internal failure: parseVec could not cast the value
Import trace for requested module:
## relevant info
This seems to be a larger issue about reference types not being supported by webpack
https://github.com/webpack/webpack/issues/15566
Not sure what bevy can do about it, but opening as it's still impacted by it.
## Known workarounds
[This workaround](https://github.com/webpack/webpack/issues/15566#issuecomment-2421927813) from the issue above seems to work
```
[profile.release]
strip = true
```
Contributor guide
Research direction
Reproduce the WASM build using the README instructions and the linked branch, then load wasm/mol_bg.wasm in the linked Next app with npm run dev. Compare the failure with webpack issue #15566 and test whether the documented [profile.release] strip = true workaround changes it. Done means identifying a Bevy-side fix or confirming the incompatibility is external.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nextjs, rust, wasm, webpack
- Domain
- build-system, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100