Open mshd opened 10 months ago
hi, im facing the same issue
const prismaClientSingleton = () => {
const prismaClient = new PrismaClient().$extends({
result: {
image: {
url: {
needs: { fileName: true },
compute(image) {
return `${process.env.NEXT_PUBLIC_HOST}/attachments/${image.fileName}`;
},
},
},
},
});
return prismaClient;
};
Argument of type 'DynamicClientExtensionThis<TypeMap<InternalArgs & { result: { image: { url: () => { needs: { fileName: true; }; compute(image: { fileName: string; }): string; }; }; }; model: {}; query: {}; client: {}; }>, TypeMapCb, { ...; }>' is not assignable to parameter of type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.
yes there should be a solution that works for all versions... will have a look this month
Still looking into it, version 5.2.1 did not fix. for now casting the client to as PrismaClient
does the job.
currently the default handler has a type conflict with
new PrismaClient({}).$extends({