-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prisma XOR with Zod > 3.21.1 not working #2184
Prisma XOR with Zod > 3.21.1 not working #2184
Comments
Thanks for creating the issue @chrishoermann ! I'm working zenstack and hit by the same thing 😄. |
We have the same problem. Since almost 3 month now we are stuck to using zod in version 3.21.1. // package.json
{
// ...
"resolutions": {
"zod": "<=3.21.1",
}
} |
This issue has been here for a while 😄. Just wondering if it's on the radar for a fix soon. |
It seems like this bug does not occur in v4.16.1 of Prisma 👍🏼 |
@Intevel No, I can confirm same error with |
Did you updated your @prisma/client aswell? |
Yes, sure |
Waiting for an update as well. Stuck here too |
any news on this one? Is it confirmed as a bug yet? |
If it's confirmed to be a bug, I'd like to try making a fix. |
Hi @colinhacks , we need some attention here 😄. Many people build Prisma-related tools using zod and all likely blocked to some extent. |
This issue needs to get more attention! |
I do agree. I sadly have switched to dirzzle for new projetcs by now. |
Zod sure has a lot of open issues for a validation library. No wonder its the most used these days. This is probably gonna take some time to get picked up without a random dev stepping in. |
Not only prisma, we recently encountered the same error with nextjs react-hook-forms zodResolver. |
Hope this problem can be solved . |
Here to add some weight to the issue |
I've got that same problem. Is there any workaround in the meantime (that isn't downgrading)? |
We need this fixed :-) |
Any news on this topic ? This is a blocking issue that prevent us to generate types from Prisma schema with latest Zod release |
We encounterd a bug when using generated prisma types with versions greater than
3.21.1
.You can reproduce the issue in the following repo: https://github.com/chrishoermann/zod-prisma-types-bug
As you can read in the following discussion we first thought it was an issue with prisma, but after digging around and finding that the suspected type has been this way for a long time now @njdowdy found that this is a zod issue that happend somwhere in
3.21.2
Discussed in #2171
Originally posted by chrishoermann March 9, 2023
I've built a generator for prisma (zod-prisma-types) that throws a type error since prisma updated their
XOR
type in 4.11:before this type update the following zod schema worked without problems:
so a simple union was sufficient to satisfy typescript. in Prisma 4.11 typescript now throws the following error because, as I see it, the
Without<...>
type can not be satisfied with a union anymore:I'm currently a bit stuck on how to solve this issue because I don't really know how to implement the
Without<...>
type especially because thez.ZodType<...>
does not provide the object helper methods that would have been my first guess on how to approach this. Any help is appreciated.The text was updated successfully, but these errors were encountered: