generated from 47ng/typescript-library-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
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.
The solution seems to be the following:
import { PrismaClient } from '@prisma/client'
import { fieldEncryptionExtension } from 'prisma-field-encryption'
import { type PrismaClientExtends } from '@prisma/client/extension'
import type * as runtime from '@prisma/client/runtime/library'
// Define the extended client type using Prisma's extension type system
type ExtendedClient = PrismaClient & PrismaClientExtends<runtime.Types.Extensions.DefaultArgs>
const globalClient = new PrismaClient()
export const client = globalClient.$extends(
// This is a function, don't forget to call it:
fieldEncryptionExtension()
) as ExtendedClient
export type { ExtendedClient as PrismaClient }
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. 🙏
Metadata
Metadata
Assignees
Labels
No labels