P
Prisma3mo ago
Darkstar

Prisma Client could not locate the Query Engine

I have a project that uses Next.js 15.3.5 and prisma 6.13.0 and @prisma/client 6.13.0. Deployed on Supabase Postgres. Project is deployed on Vercel. During development I work on a local Supabase instance. Things were working fine. I had made small changes to the schema over the last couple of weeks, so yesterday I finally did a migration and updated the Supabase DB as well. But somehow after that I am getting the below error. I was on Prisma 6.13.0 as stated above, but because of this I bumped it to latest 6.15.0, but still the same issue is present.
Unhandled Rejection: Error [PrismaClientInitializationError]: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x".

We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.

This is likely caused by a bundler that has not copied "libquery_engine-rhel-openssl-3.0.x.so.node" next to the resulting bundle.
Ensure that "libquery_engine-rhel-openssl-3.0.x.so.node" has been copied next to the bundle or in "src/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-bundler-investigation

The following locations have been searched:
/var/task/src/generated/prisma
/var/task/.next/server
/vercel/path0/src/generated/prisma
/var/task/.prisma/client
/tmp/prisma-engines
at ay (.next/server/chunks/693.js:30:1107)
at async Object.loadLibrary (.next/server/chunks/693.js:55:9086)
at async oc.loadEngine (.next/server/chunks/693.js:59:450)
at async oc.instantiateLibrary (.next/server/chunks/693.js:58:4263) {
clientVersion: '6.15.0',
errorCode: undefined
}
Unhandled Rejection: Error [PrismaClientInitializationError]: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x".

We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.

This is likely caused by a bundler that has not copied "libquery_engine-rhel-openssl-3.0.x.so.node" next to the resulting bundle.
Ensure that "libquery_engine-rhel-openssl-3.0.x.so.node" has been copied next to the bundle or in "src/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-bundler-investigation

The following locations have been searched:
/var/task/src/generated/prisma
/var/task/.next/server
/vercel/path0/src/generated/prisma
/var/task/.prisma/client
/tmp/prisma-engines
at ay (.next/server/chunks/693.js:30:1107)
at async Object.loadLibrary (.next/server/chunks/693.js:55:9086)
at async oc.loadEngine (.next/server/chunks/693.js:59:450)
at async oc.instantiateLibrary (.next/server/chunks/693.js:58:4263) {
clientVersion: '6.15.0',
errorCode: undefined
}
3 Replies
Prisma AI Help
Prisma AI Help3mo ago
You decided to hold for human wisdom. We'll chime in soon! Meanwhile, #ask-ai is there if you need a quick second opinion.
Darkstar
DarkstarOP3mo ago
Below is my prisma schema file. It's at /prisma/schema.prisma
generator client {
provider = "prisma-client-js"
output = "../src/generated/prisma"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}
generator client {
provider = "prisma-client-js"
output = "../src/generated/prisma"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}
In my package.json file, I have this script to run the prisma generate command when the project is being build.
"build": "prisma generate && next build"
"build": "prisma generate && next build"
I faced this same issue couple months ago in a different project, which at the time was on Prisma 6.5.0. https://discord.com/channels/937751382725886062/1361918134927229039 The issue happens when the custom output path is specified so in the end I removed the custom path and let the client be generated in node_modules, which was the default. This was that previous project. I don't want to do the same here as well because moving forward, in version 7.0.0 the custom path will be required. Also I have checked by adding the binaryTargets as well. But the issue is still there. I don't get how it randomly doesn't work. I was on the same version and it was working. But after the migration it doesn't. The migration was some small teaks to the schema so it also happened without any issues. I can provide the link to the whole repo if you need. It's a small personal project of mine so can be shared. Bumping this up, because I still have this issue and currently have no idea what to do. I also want to mention, I don't have any errors when the project is being built on Vercel. The logs are clean. I only get the error message when I try to access the database, for example when I try to login or signup, then only I get the above error message in the Vercel deployment logs. That error is what you see above. And I can't of course log in or signup, to the site. @Nurul Hey, sorry for the tag. But if possible, when you get some time, can you check this please?
Nurul
Nurul3mo ago
Could you share a minimal reproduction of this issue so that I can try to reproduce?

Did you find this page helpful?