Skip to content

fix: discriminated union for Zod v4 mini #784

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

Merged

Conversation

eliocapella
Copy link
Contributor

Context

When trying out the new Zod v4 mini I noticed that discriminated unions aren't supported.

Changes

  • Adding discriminated unions to the tests
  • Using the current error on invalid union if the errors array is empty

@eliocapella eliocapella changed the title fix: discriminated union for zod fix: discriminated union for Zod v4 mini Jun 19, 2025
@eliocapella
Copy link
Contributor Author

eliocapella commented Jun 19, 2025

I'm unable to get bun to work correctly in my computer, it just keeps loading forever when trying to run the tests
Screenshot 2025-06-19 at 10 20 06

@lefuncq
Copy link

lefuncq commented Jun 27, 2025

Hey, any plans to release this fix?

@cascornelissen
Copy link

As this likely fixes #793, I'd also love a release that includes this change 😍

@jorisre jorisre merged commit 49a0d7b into react-hook-form:master Jul 29, 2025
1 check passed
Copy link
Contributor

🎉 This PR is included in version 5.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants