Error configuring adapter using the new "prisma-client" ts esm generator

For some reason the "adapter" property is showing an error as if doesn't exist, even though it only works if I pass the adapter. Here is my Schema:
datasource db {
provider = "sqlite"
url = "file:./db.sqlite"
}

generator client {
provider = "prisma-client"
previewFeatures = ["driverAdapters"]
runtime = "cloudflare"
output = "../server/db/generated/prismaClient"
moduleFormat = "esm"
}
datasource db {
provider = "sqlite"
url = "file:./db.sqlite"
}

generator client {
provider = "prisma-client"
previewFeatures = ["driverAdapters"]
runtime = "cloudflare"
output = "../server/db/generated/prismaClient"
moduleFormat = "esm"
}
No description
6 Replies
Prisma AI Help
Prisma AI Help6mo ago
Skipping coffee for instant knowledge! Let's brew that AI answer now. The issue you're experiencing—where the adapter property on PrismaClient shows a TypeScript error when using the new prisma-client generator (with ESM and runtime: cloudflare)—is a known limitation and area of instability with the new generator. From the knowledge sources: - The new prisma-client generator is still experimental and not all adapters or features are fully supported or have up-to-date TypeScript typings. Users have reported that TypeScript may complain about the adapter property, even though it works at runtime if you pass the adapter. This is especially true for edge runtimes like Cloudflare Workers or Vercel Edge Functions, where the generator and adapter ecosystem is still evolving. One user noted: "PrismaClient does not support the adapter parameter, but this does not affect the use of the function"—meaning you may need to use // @ts-expect-error or similar to suppress the TypeScript error for now, as the runtime behavior is correct but the types are not yet aligned with the new generator's capabilities Error configuring adapter using the new "prisma-client" ts esm generator. - The documentation and issues confirm that the driverAdapters feature is required, and your schema is correct in that regard. However, the TypeScript types for the new generator may lag behind the runtime features, especially for edge runtimes and new adapters No Rust engine. Workaround:
You can safely use the adapter property at runtime, but to avoid TypeScript errors, use:
// @ts-expect-error
const prisma = new PrismaClient({ adapter });
// @ts-expect-error
const prisma = new PrismaClient({ adapter });
This is a temporary measure until the typings are updated for the new generator and edge runtimes. Summary:
Your configuration is correct, but the TypeScript types for the new prisma-client generator and adapter support are not fully up-to-date. Suppress the error with @ts-e xpect-error for now, and monitor Prisma releases for improved type support. 🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly. In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
Nurul
Nurul6mo ago
Hey! Is this on latest Prisma version 6.10.1?
Francisco Hermida
Francisco HermidaOP6mo ago
yes, tried on both 6.10.1 and 6.9
Nurul
Nurul6mo ago
Is your repository open source? If yes, can you share the link with me?
Francisco Hermida
Francisco HermidaOP6mo ago
Here, it shows both issues related to the threads I opened in the help channel. https://github.com/franciscohermida/repro-prisma-issues
GitHub
GitHub - franciscohermida/repro-prisma-issues
Contribute to franciscohermida/repro-prisma-issues development by creating an account on GitHub.
Nurul
Nurul6mo ago
Thanks for sharing, I'll try to reproduce it on my end 🙏

Did you find this page helpful?