Deps optimization in development mode breaks webassembly from the local filesystem packaged with pnpm #15929
Closed
7 tasks done
Labels
duplicate
This issue or pull request already exists
Describe the bug
Deps optimization with
vite dev
seems to break anything that relies on.wasm
files produced locally and bundled via pnpm.Building and running my project with
vite dev
will give you a relatively blank page, with this error in the JS console:This is because the request for the
.wasm
file didn't go through. Vite served usindex.html
instead. The byte sequence3c 21 64 6f
is<!do
, the first four bytes of myindex.html
file.Navigating to the network tab, you can see that we're requesting the
.wasm
file from http://localhost:5173/node_modules/.vite/deps/htmf_wasm_bg.wasm, but the dependency optimizer didn't actually move the.wasm
file there.To see what this project is like when it works:
pnpm run preview
builds the project correctly, without dependency optimizationnpm run dev
.Reproduction
https://github.com/jthemphill/htmf/tree/pnpm
Steps to reproduce
To build the pnpm branch of my repo:
And then navigate to http://localhost:5173/
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: