Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x"
Last verified:
The fix
The Vercel function is looking for the Linux query-engine binary and that file is not in the deployment. Generate ran for another OS, or the binary was stripped from the bundle.
- 1
Read the filename in the error
It names
libquery_engine-rhel-openssl-3.0.x.so.nodeand the folders it searched. If the message isdid not initialize yetorCannot find module '.prisma/client/default', you are on the client-not-generated page. Come back here only when the missing piece is the rhel engine binary. - 2
Generate the rhel binary on the Vercel build
On Prisma 6 with the Rust engine (
prisma-client-jsand noengineType = "client"), addrhel-openssl-3.0.xnext tonative. Commit the schema. Addprisma generateaspostinstall, which is what Prisma's Vercel guide uses. If a cached install skippedpostinstall, also run it in the build command and redeploy without relying on the cachednode_modules. Do not commitnode_modules. Do not runprisma migrate devon Vercel.generator client { provider = "prisma-client-js" binaryTargets = ["native", "rhel-openssl-3.0.x"] } - 3
Or stop shipping the Rust engine
From Prisma 6.16.0 you can set
engineType = "client"and use a driver adapter. No rhel binary is required, and the monorepo workaround plugin is unnecessary. On Prisma 7 this is the default: generatorprisma-client, anoutputpath, andnew PrismaClient({ adapter }). Import from the generated folderoutputpoints at. The sample uses the.../cliententry from Prisma's v7 driver-adapter docs. If generate prints a different entry file, import that file, not a leftover@prisma/clientfrom Prisma 6.binaryTargetson that schema does not producelibquery_engine-rhel-openssl-3.0.x.so.node.generator client { provider = "prisma-client" output = "../src/generated/prisma" } import { PrismaClient } from "../src/generated/prisma/client" import { PrismaPg } from "@prisma/adapter-pg" const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL }) export const prisma = new PrismaClient({ adapter }) - 4
Keep the binary in a monorepo bundle
If you are staying on the Rust engine in a monorepo, Prisma's Vercel guide says the function bundle can omit
libquery_engine-rhel-openssl-3.0.x.so.node. Add@prisma/nextjs-monorepo-workaround-pluginthe way that guide shows, then redeploy. Skip the plugin whenengineTypeisclientor the generator isprisma-client. A connection reset after the engine loads is the Postgres URL, not another binary target.
Why it happens
The runtime error is PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x". Prisma says tooling has not copied libquery_engine-rhel-openssl-3.0.x.so.node into the deployment, and it tells you to run prisma generate and to get that file into the server output. The folders it lists are the ones it already searched, often under .next/server.
That filename is the Rust query engine for the Vercel Node runtime, which uses OpenSSL 3. prisma generate on a Mac writes a darwin engine unless binaryTargets includes rhel-openssl-3.0.x. A client generated only for your laptop, then shipped or restored from a cache, does not start on Vercel.
Prisma's Vercel guide says the platform caches dependencies, and a cached install can leave an outdated generated client. Their fix is a postinstall of prisma generate, so a clean install regenerates during the build. If the build log shows the install was cached and postinstall did not run, put prisma generate in the build command before next build and redeploy. prisma has to be installed where that command runs. prisma: command not found means the package is only a devDependency and this install skipped devDependencies. Move prisma to dependencies.
A monorepo hits a second failure. Prisma's guide says Vercel can strip libquery_engine-rhel-openssl-3.0.x.so.node out of the function bundle, and points at @prisma/nextjs-monorepo-workaround-plugin. The same guide says you do not need the plugin once you stop shipping the Rust engine.
Prisma ORM without Rust binaries has been generally available since v6.16.0. Set engineType = "client" on the generator and pass a driver adapter, such as @prisma/adapter-pg for Postgres. No libquery_engine-*.so.node is downloaded. Prisma ORM v7 is Rust-binary-free by default. The generator is prisma-client, you set output, and new PrismaClient() without an adapter throws. binaryTargets does not create the rhel file on that setup. If v7 still throws this rhel error, the process is importing an old generated client from a cached node_modules or a committed output folder. Generate on the Vercel build and import that client.
This is not Prisma Client did not initialize yet. Please run prisma generate. That page is a client that was never generated. A connection error after this engine starts is the pooler URL. Do not set PRISMA_QUERY_ENGINE_LIBRARY to a path from the build log. The next deploy moves the file.
The next error you'll probably hit
Once this is fixed, the usual follow-up is @prisma/client did not initialize yet. @prisma/client did not initialize yet. Run prisma generate so the client matches the schema. Generate does not migrate. Restart after it succeeds.
Prompt to paste back into your AI tool
Paste this above the error.
Vercel throws PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x". It also mentions libquery_engine-rhel-openssl-3.0.x.so.node. Prisma version in package.json is <version>. Do not set PRISMA_QUERY_ENGINE_LIBRARY to a hardcoded path. Do not commit node_modules. Do not run prisma migrate dev on Vercel. Do not add binaryTargets on Prisma 7 and expect that .so.node file to appear. 1. If this is Prisma 6 with the Rust engine, add binaryTargets = ["native", "rhel-openssl-3.0.x"] and run prisma generate in postinstall and in the build command before next build. 2. If this is Prisma 6.16 or newer and we can switch, set engineType = "client" and pass a driver adapter. If this is Prisma 7, use generator prisma-client, set output, and pass the adapter. Import the generated client. 3. If this is a monorepo still on the Rust engine, include the engine file the way Prisma's Next.js monorepo workaround describes. 4. Do not edit the schema models. If the next error is a connection failure, stop and say it is the database URL.
Common questions
+prisma generate worked on my laptop and Vercel still throws. Why?
The laptop engine is not the rhel one. The Vercel build has to run prisma generate after binaryTargets includes rhel-openssl-3.0.x, or you switch to engineType client or Prisma 7 and stop looking for that file. If the build log shows a cached install that skipped postinstall, redeploy so generate runs on Vercel.
+I added binaryTargets on Prisma 7 and the .so.node file is still missing. Why?
Prisma 7 does not ship that Rust query engine by default. binaryTargets does not create libquery_engine-rhel-openssl-3.0.x.so.node. Construct PrismaClient with a driver adapter and import the client the v7 generator just wrote.
Related errors
- @prisma/client did not initialize yet@prisma/client did not initialize yet. Run prisma generate so the client matches the schema. Generate does not migrate. Restart after it succeeds.CursorBoltReplitPrismaPostgresOct 14, 2026
- self-signed certificate in certificate chainself-signed certificate in certificate chain: the Postgres URL is missing TLS. On Vercel, use the pooled URL with sslmode=require. Leave TLS checks on.CursorLovableBoltPostgresPrismaOct 14, 2026
- sorry, too many clients alreadyPostgres or the pooler refused another connection. On Vercel, each warm function was opening its own pool, and the database ran out.Cursorv0BoltPostgresPrismaOct 27, 2026
- Environment variable not found on VercelEnvironment variable not found on Vercel: .env.local stayed on your machine. Add the variable for Production, then redeploy. Do not commit that file.Cursorv0BoltVercelNext.jsOct 14, 2026