Commit 8c7e7c7
fix(sqlite3mc-wasm): restore bundler-visible wasm resolution (#24529)
SQLite3MultipleCiphers 2.3.5 (#24293) stopped shipping the
bundler-friendly build variant, so the package entry re-exports the
plain sqlite3.mjs. That loader always resolves sqlite3.wasm through its
Module['locateFile'] hook, which computes new URL(path, import.meta.url)
with a dynamic path — invisible to bundlers. Bundled consumers (e.g.
Vite apps using @aztec/kv-store/sqlite-opfs) request an unhashed
sqlite3.wasm relative to the emitted chunk and 404 at runtime; dev
servers are unaffected, so only production builds break.
Wrap the init and inject emscriptenLocateFile (the vendored loader's
supported escape hatch= resolving the wasm via a static `new
URL('../vendor/jswasm/sqlite3.wasm', import.meta.url)` that bundlers
detect, emit, and rewrite. Unbundled usage is unaffected: the static URL
resolves to the real vendored path.
Verified by building a Vite consumer against the patched dest/: the
emitted worker chunk resolves the hashed wasm asset through the hook.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent f397aa5 commit 8c7e7c7
1 file changed
Lines changed: 34 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
5 | 15 | | |
6 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
7 | 40 | | |
0 commit comments