Replies: 39 comments 42 replies
|
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? |
|
Have you tried to copy the engine in the suggested location? Did that work? Our error message suggested you to copy the engine somewhere. How did that go? Which package manager are you using? Is your workspace a monorepo setup? Is your setup hosting multiple packages in a single workspace? Is a bundler in use? If yes, which one? Are you using webpack, swc, esbuild, rollup, or any other bundler? Is a framework in use? If yes, which one? Are you using Next.js, Next, or any other framework? Your project uses TypeScript or just JavaScript? Do you prefer using TypeScript or JavaScript within your project, or both? When you saw our message, did it happen locally or in deployment? The message was "Please help us by answering a few questions". Where is your project deployed? Are you deploying to Vercel, Netlify, Lambda, or something else? |
Have you tried to copy the engine in the suggested location? Did that work?The engine already exists. It looks like Prisma is trying to delete it. Which package manager are you using?NPM v10.2.3 Is your workspace a monorepo setup?No Is a bundler in use? If yes, which one?No Is a framework in use? If yes, which one?No Your project uses TypeScript or just JavaScript?Only JavaScript When you saw our message, did it happen locally or in deployment?Locally Where is your project deployed?^^ Currently running locally |
|
Have you tried to copy the engine in the suggested location? Did that work? Prisma version: 5.1.1 |
|
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? [EDIT] The suggested workaround with the webpack plugin worked for me. ✅ |
|
Have you tried to copy the engine in the suggested location? Did that work? I ran Which package manager are you using? NPM 10.2.4 Is your workspace a monorepo setup? Yes. Is a bundler in use? If yes, which one? Yes, Vite on the frontend and tsup for data-access layer code that does prisma stuff. Is a framework in use? If yes, which one? Yes, Astro. Your project uses TypeScript or just JavaScript? All TypeScript. When you saw our message, did it happen locally or in deployment? Locally. Where is your project deployed? Docker on-prem. |
|
Have you tried to copy the engine in the suggested location? Did that work? Yes. Because I'm using Which package manager are you using? pnpm Is your workspace a monorepo setup? Yes Is a bundler in use? If yes, which one?
Is a framework in use? If yes, which one? Elysia Your project uses TypeScript or just JavaScript? TypeScript When you saw our message, did it happen locally or in deployment? Locally, inside a Dockerfile build Where is your project deployed? Docker. Railway Other Info I'm trying to build my app via Docker, and was able to work around this by adding these lines to my Dockerfile: Unfortunately this isn't ideal though as it means anytime I upgrade Prisma I'm going to have to update these paths in my Dockerfile |
|
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? |
|
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? Other note: this was my generator block. I had to add the bare imports to get it to even build. (Otherwise it complains about client.js not found, since the actual generated file is client.ts). Also note i'm using absolute import aliases so my import path looks like |
|
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? We're switching from the I tried nextjs-monorepo-workaround-plugin, but that didn't seem to help. |
Have you tried to copy the engine in the suggested location? Did that work?Yes. I've added Tried to set binaryTargets to but didn't work. For now I'll revert What do you think @millsp? Which package manager are you using?npm 10.9.2 Is your workspace a monorepo setup?No Is a bundler in use? If yes, which one?No Is a framework in use? If yes, which one?No Your project uses TypeScript or just JavaScript?Typescript When you saw our message, did it happen locally or in deployment?In deployment after I've added output file on generator client inside schema.prisma. Where is your project deployed?Cloud run but it also breaks running locally |
Have you tried to copy the engine in the suggested location? Did that work?The engine is in the specified location. Our error message suggested you to copy the engine somewhere. How did that go?No, the error just said it could not find the engine. I have checked the Docker image generated by #17 [stage-2 4/4] RUN ls -la ./src/lib/db/client
#17 sha256:832e43f1bc51f45d71235dfca6f8814975319940b83c7c6d779ebea61e3c53ed
#17 0.312 total 16924
#17 0.312 drwxr-xr-x 2 appuser appuser 4096 Apr 17 04:15 .
#17 0.312 drwxrwxrwx 3 appuser appuser 4096 Apr 17 04:14 ..
#17 0.312 -rw-r--r-- 1 appuser appuser 355930 Apr 17 04:15 client.ts
#17 0.312 -rw-r--r-- 1 appuser appuser 24 Apr 17 04:15 index.ts
#17 0.312 -rwxr-xr-x 1 appuser appuser 16957816 Apr 17 04:15 libquery_engine-debian-openssl-3.0.x.so.node
#17 DONE 0.3sThe error claims it can not find Which package manager are you using?NPM 11 Is your workspace a monorepo setup?No. Is your setup hosting multiple packages in a single workspace?No. Is a bundler in use? If yes, which one?Yes. (Fixed the issue by manually copying Is a framework in use? If yes, which one?No Are you using Next.js, Next, or any other framework?No Your project uses TypeScript or just JavaScript?Typescript When you saw our message, did it happen locally or in deployment?Deployment Where is your project deployed?AWS via Docker |
Have you tried to copy the engine in the suggested location? Did that work?Yes, I did copy the engines, but not to the suggested location. I noticed a list of searched locations in the logs. The suggested location was in a folder that doesn't exist in the final image ( Which package manager are you using?npm (10.9.2) Is your workspace a monorepo setup?No, but I am using React Email which requires having JSX and React configured. Is a bundler in use? If yes, which one?swc Is a framework in use? If yes, which one?NestJS. Your project uses TypeScript or just JavaScript?TypeScript. When you saw our message, did it happen locally or in deployment?In deployment. Where is your project deployed?Docker container on Render. |
|
Have you tried to copy the engine in the suggested location? Did that work? Yes and yes. See below I was developing a Docker image. The app ran fine locally but failed in production (GKE) so I built an identical image locally and tried to run it in Docker Desktop with (fortunately) the same error. I looked at the generated files after Here's the extra command I added to the Dockerfile:
Which package manager are you using? npm 11.2.0 Is your workspace a monorepo setup? I am using git submodules and npm workspaces but the build is always done from the top level. Each submodule of my project has a separate schema (as Postgres schema) and generates its Prisma Client to a different folder, but they are then all bundled as one 'app'. Is a bundler in use? If yes, which one? It's a Remix v2 project (soon to be React Router v7) using vite and rollup. Is a framework in use? If yes, which one? Yes. Remix v2. Your project uses TypeScript or just JavaScript? Typescript. Definitely prefer typescript as it reports on bad programming practices [not mine, of course] and forces developers to think about why they need to use unsafe code. When you saw our message, did it happen locally or in deployment? Production testing. Where is your project deployed? Google Cloud Kubernetes (GKE). |
|
Have you tried to copy the engine in the suggested location? Did that work?
Which package manager are you using?
Is your workspace a monorepo setup?
Is a bundler in use? If yes, which one?
Is a framework in use? If yes, which one?
Your project uses TypeScript or just JavaScript?
When you saw our message, did it happen locally or in deployment?
Where is your project deployed?
Other:
generator client {
provider = "prisma-client"
output = "../app/generated/prisma-client"
binaryTargets = ["native", "rhel-openssl-3.0.x"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
} |
|
for Vercel depoly, this is easy to fix: prisma-client-js: this will generate the client inside 2, in your code everywhere, use instead of 3, make sure there is 4, make sure there is and now prisma will choose the right binary files and generate the client folder for you which solves the problem of binary file can not be found, for example the problem i encountered: |
|
I am experiencing the same issue starting |
|
provider "prisma-client-js" works fine but "prisma-client" doesn't on Ubuntu 24.04 Prisma 6.16.3 Edit: tt looks like the problem is the file I fixed the problem with the config |
|
In turborepo setup with prisma (rust-free) and mongo clients the same error happens! |
|
Also having this problem. PrismaClientInitializationError Error [PrismaClientInitializationError]: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x". Tried multiple fixes
But none of them work when deploying to vercel. Works fine locally. If anyone has any idea for a fix please. This issue has been quite frustrating as I cannot even replicate it locally. |
|
All those who comment here, asking for help ... Please note that the core issue is that some deployment environments (notably Vercel) do not copy the Prisma client 'engine'. You can help yourself if you stop using the old default of generating the engine into node_modules. Generate the Prisma client into some other folder, as the documentation now recommends. Even then, some bundlers seem to need 'extra help' - explicit instructions (configuration) to copy the engine into the 'build output' folder. Some only copy 'known' file types as assets and need to be told about the Prisma engine file. (Or add a build step to copy it yourself.) Check what's placed into the Prisma client output folder and then configure your build process to move or transform all of that to the build output. |
|
I resolved it quickly by using the Rust-free Prisma client.
to
|
|
Have you tried to copy the engine in the suggested location? Did that work? Our error message suggested you to copy the engine somewhere. How did that go? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? |
|
Solution for Next.js 16 + Prisma 6 on Vercel Q: Have you tried to copy the engine in the suggested location? Did that work? Q: Which package manager are you using? Q: Is your workspace a monorepo setup? Q: Is a bundler in use? If yes, which one? Q: Is a framework in use? If yes, which one? Q: Your project uses TypeScript or just JavaScript? Q: When you saw our message, did it happen locally or in deployment? Q: Where is your project deployed? Solution
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "rhel-openssl-3.0.x"]
}
const nextConfig = {
outputFileTracingIncludes: {
"/api/**/*": ["./node_modules/.prisma/client/**/*"],
"/**/*": ["./node_modules/.prisma/client/**/*"],
},
// ... rest of config
};
export default nextConfig;Key point: Use */ pattern, not *.node, to include all Prisma client files (not just the binary). After these changes, run npx prisma generate locally, commit, and deploy. Works perfectly on Vercel now. |
Yes, I ran
The file was already in the location it needed to be (and that was one of the locations listed as having been searched).
npm 11.4.2.
No.
No.
Vite, which uses rollup underlyingly.
Express is the only framework I'm using on the backend but it's totally decoupled from my Prisma usage.
TypeScript.
Locally. The error happened in my integration tests, while the test was attempting to drop the test database after running:
I deploy to my own server in a container. But this happened locally. |
Solution for Next.js 16 + Prisma 6 on AWS Amplify.Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? SolutionIf anyone is encountering this issue with Next.js 16 + Prisma 6.19.2 on AWS Amplify (I'm using MongoDB, so I'm stuck on Prisma v6). The engine binary wasn't being included in the Lambda deployment package. I fixed it by updating these three files:
generator client {
provider = "prisma-client"
output = "../generated/prisma"
binaryTargets = ["native", "rhel-openssl-3.0.x"]
}Note that I'm using
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
outputFileTracingIncludes: {
"/": ["./src/generated/prisma/**/*.node"],
},
// ...rest of your config
};
export default nextConfig;
import "dotenv/config";
import path from "path";
import { PrismaClient } from "@/generated/prisma/client";
// Point Prisma to the engine binary location in Lambda (AWS Amplify). This is necessary because the default location is not accessible in Lambda.
if (process.env.AWS_EXECUTION_ENV) {
const enginePath = path.join(
process.cwd(),
"src/generated/prisma/libquery_engine-rhel-openssl-3.0.x.so.node"
);
process.env.PRISMA_QUERY_ENGINE_LIBRARY = enginePath;
}
const globalForPrisma = globalThis as unknown as {
prisma: PrismaClient | undefined;
};
const prisma = globalForPrisma.prisma ?? new PrismaClient();
if (process.env.NODE_ENV !== "production") {
globalForPrisma.prisma = prisma;
}
export { prisma };Without this Note: This is my first project using the custom |
|
Have you tried to copy the engine in the suggested location? Did that work? Which package manager are you using? Is your workspace a monorepo setup? Is your setup hosting multiple packages in a single workspace? Is a bundler in use? If yes, which one? Is a framework in use? If yes, which one? Your project uses TypeScript or just JavaScript? When you saw our message, did it happen locally or in deployment? Where is your project deployed? |



Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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 appreciate it if you could take 5 minutes to answer a few questions for us. You can write your reply directly in this issue as a comment. Copy and paste these questions in your answer, and leave the answer blank if you don't know.
Have you tried to copy the engine in the suggested location? Did that work?
Our error message suggested you to copy the engine somewhere. How did that go?
Which package manager are you using?
For instance
npm,pnpm, oryarn. Please attach the version if you know it.Is your workspace a monorepo setup?
Is your setup hosting multiple packages in a single workspace?
Is a bundler in use? If yes, which one?
Are you using
webpack,swc,esbuild,rollup, or any other bundler?Is a framework in use? If yes, which one?
Are you using
Next.js,Next, or any other framework?Your project uses TypeScript or just JavaScript?
Do you prefer using TypeScript or JavaScript within your project, or both?
When you saw our message, did it happen locally or in deployment?
The message was "Please help us by answering a few questions".
Where is your project deployed?
Are you deploying to Vercel, Netlify, Lambda, or something else?
All reactions