PrismaP
Prisma3mo ago
6 replies
thedappercamper

Cannot infer type of prisma accelerate extended client

I'm trying to use prisma accelerate so that I can use the caching functionality, but i'm running into an issue where typescript cannot actually infer the type of the resulting prisma client. This is the code i'm using to instantiate the client:

export function createPrismaClient() {
  return new PrismaClient().$extends(withAccelerate());
}
export type ExtendedPrismaClient = ReturnType<typeof createPrismaClient>;


This is the error that I'm getting:

The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.
Was this page helpful?