PrismaP
Prisma11mo ago
5 replies
teawithfruit

Type of extended Prisma client is too long (TS7056)

Hello, I am currently trying to install the following extension in my Prisma environment.
https://github.com/yxx4c/prisma-extension-redis

// It is not possible for Typescript to create the type for extendedClient
const extendedClient = (prismaClient: PrismaClient) => {
  return prismaClient.$extends(PrismaExtensionRedis({ config, client }));
};
type ExtendedClientType = ReturnType<typeof extendedClient>;


Unfortunately the typing of Prisma causes problems at this point. Typescript tells me that the derived/combined type from Prisma and the extension is too long (TS7056).
error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.


Is this a known bug when using $extends?
Was this page helpful?