P
Prisma6mo ago
Yusif

PrismaClientInitializationError – Missing Query Engine Binary for rhel-openssl-1.0.x on Vercel

Hello, I'm encountering a PrismaClientInitializationError that started recently. Everything was working perfectly yesterday, but now I'm getting an error at runtime when deploying on Vercel. To resolve it, I tried updating my Prisma schema with the following:
generator client {
provider = "prisma-client"
binaryTargets = ["native", "rhel-openssl-1.0.x"] // Added "rhel-openssl-1.0.x" manually
}
generator client {
provider = "prisma-client"
binaryTargets = ["native", "rhel-openssl-1.0.x"] // Added "rhel-openssl-1.0.x" manually
}
However, that didn’t resolve the issue. What’s particularly interesting is that I have two projects deployed on Vercel, both using the same Prisma generator configuration and connecting to the same database. The other project works perfectly without specifying binaryTargets, but this one suddenly stopped working as of yesterday.
⨯ Error [PrismaClientInitializationError]:
Invalid `prisma.contact.findMany()` invocation:


Prisma Client could not locate the Query Engine for runtime "rhel-openssl-1.0.x".

This is likely caused by tooling that has not copied "libquery_engine-rhel-openssl-1.0.x.so.node" to the deployment folder.
Ensure that you ran `prisma generate` and that "libquery_engine-rhel-openssl-1.0.x.so.node" has been copied to "../../vercel/path0/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-tooling-investigation

The following locations have been searched:
/vercel/path0/src/generated/prisma
/var/task/node_modules/.pnpm/@prisma+client@6.10.1_prisma@6.10.1_typescript@5.8.3__typescript@5.8.3/node_modules/@prisma/client
/var/task/node_modules/.pnpm/@prisma+client@6.10.1_prisma@6.10.1_typescript@5.8.3__typescript@5.8.3/node_modules/.prisma/client
/tmp/prisma-engines
at async c (.next/server/chunks/5978.js:1:858) {
clientVersion: '6.10.1',
errorCode: undefined,
retryable: undefined,
digest: '1772873755'
}
⨯ Error [PrismaClientInitializationError]:
Invalid `prisma.contact.findMany()` invocation:


Prisma Client could not locate the Query Engine for runtime "rhel-openssl-1.0.x".

This is likely caused by tooling that has not copied "libquery_engine-rhel-openssl-1.0.x.so.node" to the deployment folder.
Ensure that you ran `prisma generate` and that "libquery_engine-rhel-openssl-1.0.x.so.node" has been copied to "../../vercel/path0/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-tooling-investigation

The following locations have been searched:
/vercel/path0/src/generated/prisma
/var/task/node_modules/.pnpm/@prisma+client@6.10.1_prisma@6.10.1_typescript@5.8.3__typescript@5.8.3/node_modules/@prisma/client
/var/task/node_modules/.pnpm/@prisma+client@6.10.1_prisma@6.10.1_typescript@5.8.3__typescript@5.8.3/node_modules/.prisma/client
/tmp/prisma-engines
at async c (.next/server/chunks/5978.js:1:858) {
clientVersion: '6.10.1',
errorCode: undefined,
retryable: undefined,
digest: '1772873755'
}
4 Replies
Prisma AI Help
Prisma AI Help6mo ago
You opted for speed from this bot. Let's conjure up an answer right now!
Yusif
YusifOP6mo ago
Information about Prisma Schema, Client Queries and Environment:
generator client {
provider = "prisma-client"
output = "../src/generated/prisma"
binaryTargets = ["native", "rhel-openssl-1.0.x"]
importFileExtension = "ts"
}

datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}

model Contact {
id String @id @default(auto()) @map("_id") @db.ObjectId
fullName String
email String
phone String
hasWhatsApp Boolean @default(false)
description String
isCalled Boolean @default(false)
createdAt DateTime @default(now())
}

model ShortenLink {
id String @id @default(auto()) @map("_id") @db.ObjectId
slug String @unique
link String
createdAt DateTime @default(now())
}
generator client {
provider = "prisma-client"
output = "../src/generated/prisma"
binaryTargets = ["native", "rhel-openssl-1.0.x"]
importFileExtension = "ts"
}

datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}

model Contact {
id String @id @default(auto()) @map("_id") @db.ObjectId
fullName String
email String
phone String
hasWhatsApp Boolean @default(false)
description String
isCalled Boolean @default(false)
createdAt DateTime @default(now())
}

model ShortenLink {
id String @id @default(auto()) @map("_id") @db.ObjectId
slug String @unique
link String
createdAt DateTime @default(now())
}
"use server";

import type { Contact, Prisma } from "@/generated/prisma/client";
import { redirect } from "next/navigation";
import { prisma } from "@/lib/prisma";

export async function createContact(
data: Prisma.ContactCreateInput,
): Promise<{ contact: Contact; error?: never } | { contact?: never; error?: Error }> {
try {
const contact = await prisma.contact.create({ data });
return { contact };
} catch (error: unknown) {
console.log(error);
return { error: new Error("An error occured while executing createContact action") };
}
}

export async function getAllContacts() {
return await prisma.contact.findMany({ orderBy: { isCalled: "asc" } });
}

export async function updateIsCaledInfo(id: string, isCalled: boolean) {
await prisma.contact.update({ data: { isCalled: !isCalled }, where: { id } });
return true;
}

export async function deleteContact(id: string) {
await prisma.contact.delete({ where: { id } });
return true;
}
"use server";

import type { Contact, Prisma } from "@/generated/prisma/client";
import { redirect } from "next/navigation";
import { prisma } from "@/lib/prisma";

export async function createContact(
data: Prisma.ContactCreateInput,
): Promise<{ contact: Contact; error?: never } | { contact?: never; error?: Error }> {
try {
const contact = await prisma.contact.create({ data });
return { contact };
} catch (error: unknown) {
console.log(error);
return { error: new Error("An error occured while executing createContact action") };
}
}

export async function getAllContacts() {
return await prisma.contact.findMany({ orderBy: { isCalled: "asc" } });
}

export async function updateIsCaledInfo(id: string, isCalled: boolean) {
await prisma.contact.update({ data: { isCalled: !isCalled }, where: { id } });
return true;
}

export async function deleteContact(id: string) {
await prisma.contact.delete({ where: { id } });
return true;
}
OS: Vercel environment Database: MongoDB Node.js version: 18.x in Vercel Vercel environment (using prisma -v)
prisma : 6.10.1
@prisma/client : 6.10.1
Computed binaryTarget : rhel-openssl-1.0.x
Operating System : linux
Architecture : x64
Node.js : v18.20.6
TypeScript : 5.8.3
Query Engine (Node-API) : libquery-engine 9b628578b3b7cae625e8c927178f15a170e74a9c (at node_modules/.pnpm/@prisma+engines@6.10.1/node_modules/@prisma/engines/libquery_engine-rhel-openssl-1.0.x.so.node)
PSL : @prisma/prisma-schema-wasm 6.10.1-1.9b628578b3b7cae625e8c927178f15a170e74a9c
Schema Engine : schema-engine-cli 9b628578b3b7cae625e8c927178f15a170e74a9c (at node_modules/.pnpm/@prisma+engines@6.10.1/node_modules/@prisma/engines/schema-engine-rhel-openssl-1.0.x)
Default Engines Hash : 9b628578b3b7cae625e8c927178f15a170e74a9c
Studio : 0.511.0
prisma : 6.10.1
@prisma/client : 6.10.1
Computed binaryTarget : rhel-openssl-1.0.x
Operating System : linux
Architecture : x64
Node.js : v18.20.6
TypeScript : 5.8.3
Query Engine (Node-API) : libquery-engine 9b628578b3b7cae625e8c927178f15a170e74a9c (at node_modules/.pnpm/@prisma+engines@6.10.1/node_modules/@prisma/engines/libquery_engine-rhel-openssl-1.0.x.so.node)
PSL : @prisma/prisma-schema-wasm 6.10.1-1.9b628578b3b7cae625e8c927178f15a170e74a9c
Schema Engine : schema-engine-cli 9b628578b3b7cae625e8c927178f15a170e74a9c (at node_modules/.pnpm/@prisma+engines@6.10.1/node_modules/@prisma/engines/schema-engine-rhel-openssl-1.0.x)
Default Engines Hash : 9b628578b3b7cae625e8c927178f15a170e74a9c
Studio : 0.511.0
Prisma AI Help
Prisma AI Help6mo ago
Your error, PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-1.0.x", is a common deployment issue on Vercel and other serverless platforms. This typically happens when the required query engine binary is not present in the deployment output, even if you specify the correct binaryTargets in your schema.prisma. Key points and solutions from the knowledge sources: 1. Binary Not Copied by Bundler/Deployment Tooling:
The error message and several reports indicate that the problem is often due to the bundler or deployment pipeline not copying the libquery_engine-*.so.node file to the correct location in the deployed bundle. This is especially common when using custom output paths or monorepo setups, or when using frameworks like Next.js or custom build tools. Simply specifying binaryTargets is not always enough, as the deployment process must also ensure the binary is included in the output directory searched at runtime Can't find prisma binary on vercel serverless function. 2. Workarounds and Fixes: - Remove custom output (if set): Some users found that removing the custom output path from the generator block in schema.prisma allowed Vercel to find the engine binary, as the default output is better supported by the deployment pipeline Can't find prisma binary on vercel serverless function. - Use the @prisma/nextjs-monorepo-workaround-plugin: If you are using Next.js or a monorepo, adding this plugin to your next.config.js/next.config.mjs ensures the engine binary is copied correctly:
import { PrismaPlugin } from '@prisma/nextjs-monorepo-workaround-plugin';
// ...
webpack: (config, { isServer }) => {
if (isServer) config.plugins.push(new PrismaPlugin());
return config;
}

import { PrismaPlugin } from '@prisma/nextjs-monorepo-workaround-plugin';
// ...
webpack: (config, { isServer }) => {
if (isServer) config.plugins.push(new PrismaPlugin());
return config;
}

prisma 6.6.0 on vercel - could not locate the Query Engine for runtime "rhel-openssl-3.0.x" - Double-check your build scripts: Ensure prisma generate runs as part of your build or postinstall process so the binaries are generated for the correct platform. 3. Other Considerations: - If you use a custom output directory, make sure the deployment process copies all files from that directory. - If you recently updated Prisma or your deployment tooling, changes in how files are bundled or copied could cause this issue. Summary:
This is not usually a problem with your binaryTargets setting, but rather with the deployment pipeline not copying the engine binary to the right place. Try removing custom output paths, using the workaround plugin if on Next.js, and ensure your build process runs prisma generate and copies all necessary files. If the issue persists, check the engine-not-found-nextjs guide for more details. If you need more targeted help, please share your project structure and build/deployment configuration. 🤔 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
Nurul6mo ago
GitHub
PrismaClientInitializationError – Missing Query Engine Binary for...
Question Hello, I&#39;m encountering a PrismaClientInitializationError that started recently. Everything was working perfectly yesterday, but now I&#39;m getting an error at runtime when deploying ...

Did you find this page helpful?