-
-
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
Type changes in 3.23 #3431
Comments
Sorry about this. It's likely related to the changes to For others reading this here's the change: - class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {}
+ class ZodType<Output = unknown, Def extends ZodTypeDef = ZodTypeDef, Input = unknown> {} This fixes what I consider to be a bug in A side effect of this is that the inferred type of an unknown object schema is now |
Yea seems like I had "fixed" it unintentionally since the last release. not sure what change did that though tbf, looks like it was just dependency bumps really... |
I started seeing this in an automated build that proposes an upgrade to v3.23.0 from v3.22.5, I'll check it later but maybe it has something to do with this? |
@colinhacks this update has also broken typechecking on zodResolver of react-hooks-form in our projects. Will do a deeper dive later if required but wanted to flag early. |
@masterkain That's a symptom of having two different versions of Zod installed in your project. The two @paradoxloop I'd appreciate some kind of reproduction here, or some guidance on what you're seeing. I can't replicate this myself, and I checked for RHF resolver compatibility before publishing 3.23. |
I can't provide a full repro for the react-hooks-form issue, but I can share this helper hook that I believe is widely used (including in my projects) and is now erroring in the latest version:
Error:
(FieldValues is typed as Doing I don't think its an issue per-se, but any advice on what to do with this scenario now would be appreciated by anyone who comes across this too. |
Here is an updated version of the hook: |
Okay, given that this |
Upgrading to Zod 3.23.3 will resolve both the t3-env issue (see details) and React Hook Form issue! |
@colinhacks We loved the change! Any timeline where this comes back? |
Had this error today in my project after upgrading the dependencies, but then I realized it was caused by having two different versions of zod in the node_modules. Removing the different version fixed the issue for me. |
+1 to the above, was migrating from 3.22.4 to 3.23.8 and needed to make sure all microservices using zod were on the same version. |
Hi Colin,
@t3-oss/t3-env has started failing in zod@3.23: t3-oss/t3-env#222
We're not using any internal types which made me think you've unintentionally broken semver for this release?
See the source, we're basically just using ZodType:
We're also not really using the ZodType generics, so I don't think that change is relevant here. We're only using ZodType as a constraint
The text was updated successfully, but these errors were encountered: