P
Prisma4mo ago
kumard3

prisma 6.7.0 not working in vercel

I’m encountering an issue after upgrading to a new Prisma version. When calling prisma.form.create(), I get the following error: prisma:error Invalid prisma.form.create() invocation: ENOENT: no such file or directory, open '/var/task/generated/prisma/query_compiler_bg.wasm' Unhandled Rejection: Error: ENOENT: no such file or directory, open '/var/task/generated/prisma/query_compiler_bg.wasm' at Object.getQueryCompilerWasmModule (.next/server/chunks/141.js:88:10806) at <unknown> (.next/server/chunks/141.js:18:30161) at async Object.loadQueryCompiler (.next/server/chunks/141.js:18:30445) at async aK.instantiateQueryCompiler (.next/server/chunks/141.js:18:31858) { errno: -2, code: 'ENOENT', syscall: 'open', path: '/var/task/generated/prisma/query_compiler_bg.wasm' } Node.js process exited with exit status: 128. The logs above can help with debugging the issue.
16 Replies
Prisma AI Help
Prisma AI Help4mo ago
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into #ask-ai for a quick spin!
jonfanz
jonfanz4mo ago
It looks like you’re using a custom output path. Were you using one before?
kumard3
kumard3OP4mo ago
No, I was trying the new no rust engine and getting this error on prod, in local it is working fine.
Simire
Simire4mo ago
try this it worked for me. generate prisma client like ../node_modules/@your-app-name/prisma-client AND import { PrismaClient } from @your-app-name/prisma-client' don't forget to add this to your package.json "postinstall": "npx prisma generate --no-engine"
kumard3
kumard3OP4mo ago
still getting ENOENT: no such file or directory, open '/var/task/prisma/generated/query_compiler_bg.wasm' my setup schema.prisma generator client { provider = "prisma-client-js" previewFeatures = ["queryCompiler", "driverAdapters"] output = "./generated/" } prisma client import { PrismaPg } from "@prisma/adapter-pg"; import { PrismaClient } from "../../prisma/generated"; const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL }); export const db = new PrismaClient({ adapter, log: ["query", "error", "warn"], });
unrok4009
unrok40094mo ago
@kumard3 change provider in the generator block to "prisma-client" instead of "prisma-client-js" run prisma generate after that anyway, most likely u wont want to use query compiler feature right now as its not ready for production yet for example, arrays get returned as comma delimited string
Simire
Simire4mo ago
try this approach Generate the Prisma Client inside node_modules In your schema.prisma, set the output path for the client to a directory inside node_modules, for example: generator client { provider = "prisma-client-js" output = "../node_modules/@my-app/prisma-client" } Then, import your client like this: import { PrismaClient } from '@my-app/prisma-client'; This approach is recommended in several discussions and has resolved the exports is not defined error for others using SvelteKit, Vite, and similar tools Prisma Sveltekit Generated Client -> exports is not defined, Multiple Connections / Databases / Datasources. i tried the approach and my app is working well on netlify after days of finding solution
kumard3
kumard3OP4mo ago
tried both the solution, but getting the same error @Simire @unrok4009
Unhandled Rejection: Error: ENOENT: no such file or directory, open '/var/task/client/node_modules/@client/prisma-client/query_compiler_bg.wasm'
at Object.getQueryCompilerWasmModule (/var/task/client/node_modules/@client/prisma-client/index.js:638:58)
at <unknown> (/var/task/client/node_modules/@client/prisma-client/runtime/client.js:74:23093)
at async Object.loadQueryCompiler (/var/task/client/node_modules/@client/prisma-client/runtime/client.js:74:23380)
at async Ot.instantiateQueryCompiler (/var/task/client/node_modules/@client/prisma-client/runtime/client.js:74:25013) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/var/task/client/node_modules/@client/prisma-client/query_compiler_bg.wasm'
}
Node.js process exited with exit status: 128. The logs above can help with debugging the issue.
Unhandled Rejection: Error: ENOENT: no such file or directory, open '/var/task/client/node_modules/@client/prisma-client/query_compiler_bg.wasm'
at Object.getQueryCompilerWasmModule (/var/task/client/node_modules/@client/prisma-client/index.js:638:58)
at <unknown> (/var/task/client/node_modules/@client/prisma-client/runtime/client.js:74:23093)
at async Object.loadQueryCompiler (/var/task/client/node_modules/@client/prisma-client/runtime/client.js:74:23380)
at async Ot.instantiateQueryCompiler (/var/task/client/node_modules/@client/prisma-client/runtime/client.js:74:25013) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/var/task/client/node_modules/@client/prisma-client/query_compiler_bg.wasm'
}
Node.js process exited with exit status: 128. The logs above can help with debugging the issue.
@unrok4009 getting this specific error when trying "prisma-client"
Failed to compile.
./prisma/generated/internal/class.ts:76:40
Type error: Could not find a declaration file for module '@prisma/client/runtime/query_compiler_bg.postgresql.mjs'. '/vercel/path0/client/node_modules/.pnpm/@prisma+client@6.7.0_prisma@6.7.0_typescript@5.7.2__typescript@5.7.2/node_modules/@prisma/client/runtime/query_compiler_bg.postgresql.mjs' implicitly has an 'any' type.
If the '@prisma/client' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '@prisma/client/runtime/query_compiler_bg.postgresql.mjs';`
74 | config.engineWasm = undefined
75 | config.compilerWasm = {
> 76 | getRuntime: async () => await import("@prisma/client/runtime/query_compiler_bg.postgresql.mjs"),
| ^
77 |
78 | getQueryCompilerWasmModule: async () => {
79 | const { readFile } = await import('node:fs/promises')
 ELIFECYCLE  Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1
Failed to compile.
./prisma/generated/internal/class.ts:76:40
Type error: Could not find a declaration file for module '@prisma/client/runtime/query_compiler_bg.postgresql.mjs'. '/vercel/path0/client/node_modules/.pnpm/@prisma+client@6.7.0_prisma@6.7.0_typescript@5.7.2__typescript@5.7.2/node_modules/@prisma/client/runtime/query_compiler_bg.postgresql.mjs' implicitly has an 'any' type.
If the '@prisma/client' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '@prisma/client/runtime/query_compiler_bg.postgresql.mjs';`
74 | config.engineWasm = undefined
75 | config.compilerWasm = {
> 76 | getRuntime: async () => await import("@prisma/client/runtime/query_compiler_bg.postgresql.mjs"),
| ^
77 |
78 | getQueryCompilerWasmModule: async () => {
79 | const { readFile } = await import('node:fs/promises')
 ELIFECYCLE  Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1
There is one more weird things that is, I have a static route which generate some page and in that it is working at the build time, both using same api..
jonfanz
jonfanz4mo ago
Hi! Would you mind giving us a reproduction repo so we can dig into this further?
unrok4009
unrok40094mo ago
could u do pnpm install prisma@dev @prisma/client@dev regenerate prisma client, and check again? 6.7.0 is using /* @ts-nocheck */ instead of // @ts-nocheck comment which works only for one line instead of whole file
Simire
Simire4mo ago
check how i did mine
No description
No description
No description
kumard3
kumard3OP4mo ago
@jonfanz this is a clone repo which i am using. the setup is still same . https://github.com/kumard3/prisma-no-rust at the build time the prisma client is working, it is creating a static page https://prisma-no-rust.vercel.app/
GitHub
GitHub - kumard3/prisma-no-rust
Contribute to kumard3/prisma-no-rust development by creating an account on GitHub.
kumard3
kumard3OP4mo ago
@Simire the
npx prisma generate --no-engine
npx prisma generate --no-engine
, is actually not wokring and this is the error i am getting at the build time
Error [PrismaClientValidationError]: Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.
Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter.
at xu (/vercel/path0/client/node_modules/@client/prisma-client/runtime/client.js:76:9633)
at new t (/vercel/path0/client/node_modules/@client/prisma-client/runtime/client.js:93:3897)
at <unknown> (/vercel/path0/client/.next/server/chunks/608.js:85:2218) {
clientVersion: '6.7.0'
}
> Build error occurred
Error: Failed to collect page data for /single-product/
at <unknown> (/vercel/path0/client/node_modules/.pnpm/next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/utils.js:1234:15) {
type: 'Error'
}
 ELIFECYCLE  Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1
Error [PrismaClientValidationError]: Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.
Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter.
at xu (/vercel/path0/client/node_modules/@client/prisma-client/runtime/client.js:76:9633)
at new t (/vercel/path0/client/node_modules/@client/prisma-client/runtime/client.js:93:3897)
at <unknown> (/vercel/path0/client/.next/server/chunks/608.js:85:2218) {
clientVersion: '6.7.0'
}
> Build error occurred
Error: Failed to collect page data for /single-product/
at <unknown> (/vercel/path0/client/node_modules/.pnpm/next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/utils.js:1234:15) {
type: 'Error'
}
 ELIFECYCLE  Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1
@jonfanz There is no issue when running it on local. It is only happening at the production. this is still not working.
unrok4009
unrok40094mo ago
looks like prisma bug then, updating to dev should at least silence compilation type errors your best bet is using driverAdapters feature without queryCompiler for now also this ^
kumard3
kumard3OP4mo ago
@Jon Harrell i have updated to prisma 6.8.2 and i am getting this error at vercel and netlify
Unhandled Rejection: [Error [PrismaClientInitializationError]: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x".

This is likely caused by tooling that has not copied "libquery_engine-rhel-openssl-3.0.x.so.node" to the deployment folder.
Ensure that you ran `prisma generate` and that "libquery_engine-rhel-openssl-3.0.x.so.node" has been copied to "../../vercel/path0/generated/prisma".

We would appreciate if you could take the time to share some information with us.
Please help us by answering a few questions: https://pris.ly/engine-not-found-tooling-investigation

The following locations have been searched:
/vercel/path0/generated/prisma
/var/task/node_modules/.pnpm/@prisma+client@6.8.2_prisma@6.8.2_typescript@5.8.3__typescript@5.8.3/node_modules/@prisma/client
/var/task/node_modules/.pnpm/@prisma+client@6.8.2_prisma@6.8.2_typescript@5.8.3__typescript@5.8.3/node_modules/.prisma/client
/tmp/prisma-engines] {
clientVersion: '6.8.2',
errorCode: undefined,
retryable: undefined
}
Node.js process exited with exit status: 128. The logs above can help with debugging the issue.
Unhandled Rejection: [Error [PrismaClientInitializationError]: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x".

This is likely caused by tooling that has not copied "libquery_engine-rhel-openssl-3.0.x.so.node" to the deployment folder.
Ensure that you ran `prisma generate` and that "libquery_engine-rhel-openssl-3.0.x.so.node" has been copied to "../../vercel/path0/generated/prisma".

We would appreciate if you could take the time to share some information with us.
Please help us by answering a few questions: https://pris.ly/engine-not-found-tooling-investigation

The following locations have been searched:
/vercel/path0/generated/prisma
/var/task/node_modules/.pnpm/@prisma+client@6.8.2_prisma@6.8.2_typescript@5.8.3__typescript@5.8.3/node_modules/@prisma/client
/var/task/node_modules/.pnpm/@prisma+client@6.8.2_prisma@6.8.2_typescript@5.8.3__typescript@5.8.3/node_modules/.prisma/client
/tmp/prisma-engines] {
clientVersion: '6.8.2',
errorCode: undefined,
retryable: undefined
}
Node.js process exited with exit status: 128. The logs above can help with debugging the issue.
same error on both vercel and netlify

Did you find this page helpful?