I cant deploy my turbo repo on vercel, my file client.ts in my DB package can’t find the generated prisma files during my turbo build.
It works locally, but on vercel i get an error.
//client.ts
import { withAccelerate } from "@prisma/extension-accelerate";
import { PrismaClient } from "./generated/prisma/client";
const globalForPrisma = global as unknown as { prisma: PrismaClient };
export const prisma =
globalForPrisma.prisma || new PrismaClient().$extends(withAccelerate());
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
Both apps/web and apps/docs import Prisma via the shared packages/db.
What was happning
In a monorepo setup (apps/ + packages/), Prisma Client (and the Query Engine .so.node) is often generated inside a shared package (e.g. packages/db/...). With Next.js 16, builds default to Turbopack, and I found that in this mode the Prisma workaround that relies on Webpack hooks didn’t reliably run / copy the engine into the server output. This resulted in either:
build-time “could not resolve Prisma Client”, or
runtime “Prisma Client could not locate the Query Engine (rhel-openssl-3.0.x)” on Vercel