Problem with prisma-client generator on vercel with a monorepo

Speaking to you guys on twitter. i hvae been using the monorepo-plugin, and wanted to move away from it. The first step was to move to the new generator, which works perfectly locally, but is still throwing up errors on vercel due to it not locating 'Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x".'
No description
6 Replies
Prisma AI Help
You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the #ask-ai channel awaits if you're curious!
Ramparts
RampartsOP2d ago
generator client {
provider = "prisma-client"
output = "./client"
importFileExtension = ""
binaryTargets = ["native", "linux-arm64-openssl-1.0.x", "linux-arm64-openssl-3.0.x"]
}
generator client {
provider = "prisma-client"
output = "./client"
importFileExtension = ""
binaryTargets = ["native", "linux-arm64-openssl-1.0.x", "linux-arm64-openssl-3.0.x"]
}
No description
Ramparts
RampartsOP2d ago
database is in a package, "packages/database" loaded in my app
import { PrismaClient } from "@company/database";

function createPrisma() {
return new PrismaClient();
}

const globalForPrisma = global as unknown as {
prisma: ReturnType<typeof createPrisma>;
};

export const prisma = globalForPrisma.prisma ?? createPrisma();

if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;

export default prisma;
import { PrismaClient } from "@company/database";

function createPrisma() {
return new PrismaClient();
}

const globalForPrisma = global as unknown as {
prisma: ReturnType<typeof createPrisma>;
};

export const prisma = globalForPrisma.prisma ?? createPrisma();

if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;

export default prisma;
following command is run as part of build
prisma generate --no-hints
prisma generate --no-hints
Marc Hess
Marc Hess2d ago
Hey Ramparts, thanks for making a thread. Let me catch up to speed. Also @Nurul is our main support in discord so he may be able to help if i cant. Also just pining @Aidan McAlister for another set of eyes. I think some others have had this issue as well, let me ask the team and get back to you
Ramparts
RampartsOP2d ago
yeah, found similar on github, last night after posting: https://github.com/prisma/prisma/discussions/19498#discussioncomment-12976746
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...
Ramparts
RampartsOP2d ago
obviously not copying the native env files over at the same time. I did try the new rust based one, but I have other issues to fix with that first

Did you find this page helpful?