P
Prisma•6mo ago
mr nooli

ENOENT: no such file or directory, open '/var/task/prisma/query_compiler_bg.wasm'

Query compiler doesn't work when deployed on Vercel...
Unhandled Rejection: Error: ENOENT: no such file or directory, open '/var/task/prisma/query_compiler_bg.wasm'
at Object.getQueryCompilerWasmModule (.next/server/chunks/1024.js:1:239583)
at <unknown> (.next/server/chunks/1024.js:19:40874)
at async Object.loadQueryCompiler (.next/server/chunks/1024.js:19:41158)
at async ot.instantiateQueryCompiler (.next/server/chunks/1024.js:19:42740) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/var/task/prisma/query_compiler_bg.wasm'
}
Unhandled Rejection: Error: ENOENT: no such file or directory, open '/var/task/prisma/query_compiler_bg.wasm'
at Object.getQueryCompilerWasmModule (.next/server/chunks/1024.js:1:239583)
at <unknown> (.next/server/chunks/1024.js:19:40874)
at async Object.loadQueryCompiler (.next/server/chunks/1024.js:19:41158)
at async ot.instantiateQueryCompiler (.next/server/chunks/1024.js:19:42740) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/var/task/prisma/query_compiler_bg.wasm'
}
Why is the query compiler considered ready for use?? It's incredibly buggy and I'm still unable to get it running properly without fault or issue.
4 Replies
Prisma AI Help
Prisma AI Help•6mo ago
You opted for speed from this bot. Let's conjure up an answer right now! The error ENOENT: no such file or directory, open '/var/task/prisma/query_compiler_bg.wasm' when deploying to Vercel is a known issue with Prisma's new query compiler and driver adapters, especially in monorepo or custom output setups. The root cause is that the generated Prisma Client expects the query_compiler_bg.wasm file to be present at a specific path, but Vercel's deployment process often does not copy this file to the correct location, leading to runtime failures. This problem is widely reported by users trying to use the queryCompiler and driverAdapters preview features in monorepos or with custom generator outputs. The WASM file is either not included in the build output or is looked for in the wrong directory, both locally and on Vercel. Workarounds like manually editing the generated client code to fix the path have been suggested, but these are not sustainable as the code is regenerated on each build. The issue persists even in recent Prisma versions (6.9.0 and later) and is consistently reproducible in both development and production environments on Vercel and similar platforms. There is currently no official fix, and the Prisma team is aware and investigating the problem. For now, the only reliable workaround is to avoid using the queryCompiler and driverAdapters features in these environments, or to stick with the default client setup without these preview features. Users have expressed frustration, as the features are not production-ready for these deployment scenarios and can block critical workflows Prisma Postgres Adapter with Turborepo does not work, 6.7.0 problems with null fields, monorepo. In summary: The query compiler is not yet robust for all deployment targets, especially Vercel and monorepos. The Prisma team is working on it, but for now, these features should be considered experimental and not fully production-ready in the se contexts. 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
Nurul
Nurul•6mo ago
Hey! Can you check if this workaround fixes the issue for you? https://github.com/prisma/prisma/issues/27083#issuecomment-2979398021
GitHub
Prisma Postgres Adapter with Turborepo does not work · Issue #2708...
Bug description if I have a turborepo monorepo with a packages/db folder containing my prisma schema, and a apps/web application (Next.JS) and I use the updated prisma with previewFeatures = [&quot...
mr nooli
mr nooliOP•6mo ago
Neither of those fixed it - just ran into more issues.
Nurul
Nurul•6mo ago
Would it be possible for you to provide a minimal reproduction repository? We are working on resolving the bugs and making the new QueryCompiler more stable as we work towards moving it from Preview to Production ready.

Did you find this page helpful?