Error using PrismaClient with Cloudflare Pages

I'm successfully using Prisma with a CF Workers project using the adapter like this:
const prisma = new PrismaClient({ adapter: new PrismaD1(c.env.DB) });
const prisma = new PrismaClient({ adapter: new PrismaD1(c.env.DB) });
However, when I try to use the same client in a Pages project I get the following error:
Error: PrismaClient is not configured to run in Cloudflare Workers
Error: PrismaClient is not configured to run in Cloudflare Workers
The client object is created successfully, but the error throws on the first query.
2 Replies
5H0
5H04w ago
Did you ever manage to fix this?
Nurul
Nurul4w ago
Apologies for missing this conversation. This slipped through the cracks. To confirm, are you following instructions from this guide: https://www.prisma.io/docs/orm/prisma-client/deployment/edge/deploy-to-cloudflare
Deploy to Cloudflare Workers & Pages | Prisma Documentation
Learn the things you need to know in order to deploy an app that uses Prisma Client for talking to a database to a Cloudflare Worker or to Cloudflare Pages.
Want results from more Discord servers?
Add your server