I keep getting this error `Object literal may only specify known properties, and 'adapter' CF D1
I am using Cloudflare D1 and I keep getting this error
Object literal may only specify known properties, and 'adapter' does not exist in type 'Subset<PrismaClientOptions, PrismaClientOptions>'.ts(2353)
Using this code:
My Prisma file looks like this:
7 Replies
You're in no rush, so we'll let a dev step in. Enjoy your coffee, or drop into
#ask-ai
if you get antsy for a second opinion!Am I doing something wrong where
I get this error with passing adapter in const prisma = new PrismaClient({ adapter });
Hey!
Did you try following this guide?
https://www.prisma.io/docs/guides/cloudflare-d1
How to use Prisma ORM with Cloudflare D1 | Prisma Documentation
Learn how to use Prisma ORM with Cloudflare D1
Do you get the same error if you follow the steps mentioned in the guide?
Here's a working example:
https://github.com/prisma/prisma-examples/tree/latest/deployment-platforms/edge/cloudflare-workers/with-d1
GitHub
prisma-examples/deployment-platforms/edge/cloudflare-workers/with-d...
🚀 Ready-to-run Prisma example projects. Contribute to prisma/prisma-examples development by creating an account on GitHub.
I did and I get the same issue
I am using hono for api endpoints
Here is my index file
But I still get the error
to the prisma schema npx prisma generate would update the types outside node_modules so when importing the function, PrismaClient with the adaptar it did not have the correct types
Object literal may only specify known properties, and 'adapter' does not exist in type 'Subset<PrismaClientOptions, PrismaClientOptions>'.ts(
@Nurul (Prisma) I am trying to push to cloudlfare workers
The error in the cloudflare log is
But I am using the latest prisma version
The issue was when addingto the prisma schema npx prisma generate would update the types outside node_modules so when importing the function, PrismaClient with the adaptar it did not have the correct types
Hey!
If I understand correctly, the issue got resolved after you removed output?