TypeScript errors with new `prisma-client` generated client
Hello people! I have a small question: I tried to update a small project to use the new generated client feature. It runs fine and it all works as it should, but when I run
tsc -b
to perform type checking, it fails with
app/generated/prisma/client/client.ts:341:16 - error TS4094: Property '_brand_DbNull' of exported anonymous class type may not be private or protected. 341 export const DbNull = runtime.objectEnumValues.instances.DbNullI'm not quite sure how to resolve this. Does anyone have a suggestion? I made a public reproduction: https://github.com/jensmeindertsma/fuel/pull/6 feel free to clone this branch and run~~ app/generated/prisma/client/client.ts:341:16 341 export const DbNull = runtime.objectEnumValues.instances.DbNull~~ Add a type annotation to the variable DbNull. app/generated/prisma/client/client.ts:348:16 - error TS4094: Property '_brand_JsonNull' of exported anonymous class type may not be private or protected. 348 export const JsonNull = runtime.objectEnumValues.instances.JsonNull~~ app/generated/prisma/client/client.ts:348:16 348 export const JsonNull = runtime.objectEnumValues.instances.JsonNull~~ Add a type annotation to the variable JsonNull. app/generated/prisma/client/client.ts:355:16 - error TS4094: Property '_brand_AnyNull' of exported anonymous class type may not be private or protected. 355 export const AnyNull = runtime.objectEnumValues.instances.AnyNull~app/generated/prisma/client/client.ts:355:16 355 export const AnyNull = runtime.objectEnumValues.instances.AnyNull~Add a type annotation to the variable AnyNull. Found 3 errors.
pnpm install && pnpm typecheck
to see the issue. Thanks so much in advance!GitHub
Upgrade Prisma by jensmeindertsma · Pull Request #6 · jensmeinder...
I tried to upgrade Prisma to use the new generated client feature. I ran into some issues with TypeScript type checking:
❯ pnpm typecheck
> @jensmeindertsma/fuel@ typecheck /home/jens/deve...
3 Replies
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into
#ask-ai
for a quick spin!Just to confirm, if you ran
tsc -b
command with Prisma version 6.5.0, it was working fine?Yes, this was working fine. With version 6.5.0 I was using the non-generated client, if I try using 6.5.0 while also setting
output
( also switch back to prisma-client-js
) I ran into the weird problem that the whole client was being printed to the terminal, causing my terminal emulator to quickly run out of memory
This looks something like this:
times 100000000 in length
It looks as it the Prisma Client contains some invalid typescript code
If I can do anything to help debug this further please let me know 😊