Vercel Deploy Error

I am using "@prisma/client": "^6.14.0", "prisma": "^6.14.0", generator client { provider = "prisma-client" output = "../src/generated/prisma" previewFeatures = ["fullTextSearchPostgres"] } [Better Auth]: PrismaClientInitializationError Error [PrismaClientInitializationError]: Invalid prisma.verification.create() invocation: 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 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 ".next/server/app/api/auth/[...all]". . Please help us by answering a few questions: https://pris.ly/engine-not-found-tooling-investigation The following locations have been searched: /var/task/.next/server/app/api/auth/[...all] /vercel/path0/src/generated /vercel/path0/src/generated/prisma /vercel/path0/.prisma/client /tmp/prisma-engine } 2025-10-12T07:52:08.316Z [error] # SERVER_ERROR: Error [PrismaClientInitializationError]: Invalid prisma.verification.create() invocation: 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 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 ".next/server/app/api/auth/[...all]". We would appreciate it 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
Prisma
Prisma | Instant Postgres plus an ORM for simpler db workflows
Build, fortify, and grow your application easily with an intuitive data model, type-safety, automated migrations, connection pooling and caching.
GitHub
User questions: Engine not found (tooling) · prisma prisma · Disc...
Hi, you have been directed to this issue because we want to learn more about your project setup. Thanks to your answers, we will be able to make better design decisions in the future. We'd appr...
2 Replies
Prisma AI Help
Prisma AI Help2mo ago
You selected the bot's instantaneous insights. Let me compile your answer right away! Your error is a common issue when deploying Prisma with Next.js on Vercel, especially when using a custom output path for the Prisma Client. The error means the required query engine binary (libquery_engine-rhel-openssl-3.0.x.so.node) is not being found in the deployment environment. Key points and solutions: 1. Custom Output Path Issue:
When you set a custom output (like ../src/generated/prisma), Vercel’s build process may not copy the query engine binary to the right place. This is a known problem and is frequently reported by users deploying to Vercel with a custom output path for Prisma Client. The Prisma team and community have found that Vercel does not always include the engine binary in the serverless function bundle when a custom output is used, leading to this error Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x". 2. Recommended Workaround:
Add the @prisma/nextjs-monorepo-workaround-plugin to your Next.js next.config.js (or .ts) file. This plugin ensures the query engine binary is copied to the correct location during the build. Example:
// next.config.js or next.config.ts
const { PrismaPlugin } = require('@prisma/nextjs-monorepo-workaround-plugin');

module.exports = {
webpack: (config, { isServer }) => {
if (isServer) {
config.plugins.push(new PrismaPlugin());
}
return config;
},
};

// next.config.js or next.config.ts
const { PrismaPlugin } = require('@prisma/nextjs-monorepo-workaround-plugin');

module.exports = {
webpack: (config, { isServer }) => {
if (isServer) {
config.plugins.push(new PrismaPlugin());
}
return config;
},
};

This approach has resolved the issue for many users with similar setups see here. 3. Alternative:
If you do not need a custom output, consider removing the output field from your generator block. This allows Vercel’s default behavior to work, as it expects Prisma Client in its default location source. 4. Other Notes:
- Make sure you run prisma generate as part of your build process. - If you are using Turborepo or a monorepo, the plugin above is especially important. Summary:
Add the workaround plugin to your Next.js config, or avoid using a custom output path for the Prisma Client. This should resolve the missing query engine error on Vercel deployments with Prisma 6.x+ and Next.js. If you still have issues, see the official Prisma docs for Next.js deployment troubleshooting. ✅ Great, thanks for letting us know that this solved your question!
Diwan Sachidu
Diwan SachiduOP2mo ago
#ask-ai 2025-10-12T20:38:24.794Z [error] 2025-10-12T20:38:24.793Z ERROR [Better Auth]: INTERNAL_SERVER_ERROR Error [PrismaClientInitializationError]: Invalid prisma.session.findFirst() invocation: 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 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 ".next/server/chunks". 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: /var/task/.next/server/chunks /vercel/path0/src/generated /vercel/path0/src/generated/prisma /vercel/path0/.prisma/client /tmp/prisma-engines at async Object.findOne (.next/server/chunks/7483.js:176:566719) at async Object.findOne (.next/server/chunks/7483.js:166:45098) at async Object.findSession (.next/server/chunks/7483.js:2:60593) at async (.next/server/chunks/7483.js:168:134695) at async d (.next/server/chunks/7483.js:97:70897) at async c.<computed> [as getSession] (.next/server/chunks/7483.js:97:12430) { clientVersion: '6.17.1', errorCode: undefined, retryable: undefined } 2025-10-12T20:38:24.794Z [error] Auth error in tRPC context: [Error [APIError]: Failed to get session] { status: 'INTERNAL_SERVER_ERROR', body: [Object], headers: {}, statusCode: 500 }
Prisma
Prisma | Instant Postgres plus an ORM for simpler db workflows
Build, fortify, and grow your application easily with an intuitive data model, type-safety, automated migrations, connection pooling and caching.
GitHub
User questions: Engine not found (tooling) · prisma prisma · Disc...
Hi, you have been directed to this issue because we want to learn more about your project setup. Thanks to your answers, we will be able to make better design decisions in the future. We&#39;d appr...

Did you find this page helpful?