Support Prisma Client Extensions
Prerequisites
- [X] I have written a descriptive issue title
- [X] I have searched existing issues to ensure the bug has not already been reported
Versions
3.1.1
A minimal reproducible example
I'll add a minimal reproduction if it proves necessary.
Description
Hi, I'm experiencing no type checking when using Prisma's create method. This is really baffling as the generated type seem alright:
export type ordersCreateInput = {
...
meta?: PrismaJson._OrderMeta | NullableJsonNullValueInput
...
}
In the method call however, I can assign any value I want to the meta field with no error:
this.prisma.orders
.create({
data: {
...
meta: 10,
...
})
Doing it this way will raise an error though:
const test: Prisma.ordersCreateInput['meta'] = 10;
Do you know what could it be?
Steps to Reproduce
I'll add a minimal reproduction if it proves necessary.
Expected Behavior
No response
I'll need a minimal reproduction repo to test it out :/
I'll need a minimal reproduction repo to test it out :/
https://github.com/rivatove/prisma-json-types-generator-418/blob/master/prisma/seed.ts
Type-checking doesn't work with:
previewFeatures = ["strictUndefinedChecks"]
I don't think it's the only reason as removing that flag doesn't seem to fix that in my production app, but it's a good start and we can iterate further when you look into that.
I fixed the strictUndefinedChecks problem with the latest release, would you mind testing it out again?
https://github.com/arthurfiorette/prisma-json-types-generator/releases/tag/v3.2.0
I fixed the
strictUndefinedChecksproblem with the latest release, would you mind testing it out again?https://github.com/arthurfiorette/prisma-json-types-generator/releases/tag/v3.2.0
It seems Prisma client extensions cause the issue. See updated reproduction: https://github.com/rivatove/prisma-json-types-generator-418/blob/master/prisma/seed.ts
Thanks for the reproduction steps, sadly I do not have time to fix this right now but i'd love to review a PR fixing this.
Understandable. I'm putting a $120 bounty for anyone that fixes this and has his PR merged and released. Valid until such functionality is not supported natively by Prisma.
2025-02-08 EDIT: I'm cancelling the bounty because I stopped using Prisma extensions.
I'll work on this, let's me see if I can find a clever solution for this!
I'm experiencing the same issue. When my Prisma client includes any extensions, all type checking of input data is gone. Any update on if/when this might be fixed?
lets see if copilot can fix this one too!
Fixed in v4.0.1