You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been running into an issue where the VSCode Typescript errors with errors like the following:
Excessive stack depth comparing types...
This expression is not callable....
After searching and consulting with various AI oracles I realized the issue could be solved by removing the prisma-field-encryption extension. This Github issue was a hint, although the discussion is from when clientExtensions were a preview feature.
import{PrismaClient}from'@prisma/client'import{fieldEncryptionExtension}from'prisma-field-encryption'import{typePrismaClientExtends}from'@prisma/client/extension'importtype*asruntimefrom'@prisma/client/runtime/library'// Define the extended client type using Prisma's extension type systemtypeExtendedClient=PrismaClient&PrismaClientExtends<runtime.Types.Extensions.DefaultArgs>constglobalClient=newPrismaClient()exportconstclient=globalClient.$extends(// This is a function, don't forget to call it:fieldEncryptionExtension())asExtendedClientexporttype{ExtendedClientasPrismaClient}
Does this fix make sense? It is working nicely for me. If so I'd like to open a PR to add this to the Readme. 🙏
The text was updated successfully, but these errors were encountered:
Yes I think that would be a good addition, thanks!
I had to do something similar in the integration tests, though my use-case was getting the same type for a client using the middleware approach and one with the extension approach:
I've been running into an issue where the VSCode Typescript errors with errors like the following:
After searching and consulting with various AI oracles I realized the issue could be solved by removing the prisma-field-encryption extension. This Github issue was a hint, although the discussion is from when clientExtensions were a preview feature.
prisma/prisma#17236
The solution seems to be the following:
Does this fix make sense? It is working nicely for me. If so I'd like to open a PR to add this to the Readme. 🙏
The text was updated successfully, but these errors were encountered: