[6.x] WebAssembly.instantiate(): Import #0 "./query_compiler_bg.js": module is not an object or function]
Problem
Bug description Nitro + Prisma 6.6.0 + D1 does not work Severity ๐จ Critical: Data loss, app crash, security issue Reproduction https://github.com/medz/nitro-prisma-6.6 Expected vs. Actual Behavior Expected behavior: WASM modules can be parsed normally Frequency Consistently reproducible Does this occur in development or production? Only in development (e.g., CLI tools, migrations, Prisma Studio) Is this a regression? Prisma: 6.6.0 Nitro: 2.11.9 wrangler: 4.10.0 Workaround - Prisma Schema & Queries [code block] [code block] Logs & Debug Info [code block] Environment & Setup - OS: - Database: - Node.js version: Prisma Version [code block]
Error Output
Error: [unwasm] Failed to parse wasm/query_compiler_bg.sqlite-afbae85635953d66.wasm: Error: Internal failure: parseVec could not cast the value
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: [6.x] WebAssembly.instantiate(): Import #0 "./query_compiler_bg.js": module is not an object or function]
I was able to reproduce the error based on the reproduction repository: <img width="1117" alt="Image" src="https://github.com/user-attachments/assets/341161fa-30c5-4a1b-9163-02d41bee3f79" /> Interestingly, when I tried downgrading to version 6.5.0, I got this error as well: <img width="1117" alt="Image" src="https://github.com/user-attachments/assets/69384dfc-bb32-4a9b-9b7c-059df05c1de5" />
Trust Score
3 verifications
- 1
I was able to reproduce the error based on the reproduction repository:
I was able to reproduce the error based on the reproduction repository:
- 2
<img width="1117" alt="Image" src="https://github.com/user-attachments/assets/34
<img width="1117" alt="Image" src="https://github.com/user-attachments/assets/341161fa-30c5-4a1b-9163-02d41bee3f79" />
- 3
Interestingly, when I tried downgrading to version 6.5.0, I got this error as we
Interestingly, when I tried downgrading to version 6.5.0, I got this error as well:
- 4
<img width="1117" alt="Image" src="https://github.com/user-attachments/assets/69
<img width="1117" alt="Image" src="https://github.com/user-attachments/assets/69384dfc-bb32-4a9b-9b7c-059df05c1de5" />
Validation
Resolved in prisma/prisma GitHub issue #26880. Community reactions: 2 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep