future/coerceFormValue (zod v4): .required(...) is improperly handled
#1083
Closed
transparent-citizen
started this conversation in
General
Replies: 1 comment 2 replies
-
|
hi @transparent-citizen I fixed the bug here. If you need the fix right away, you can try it via |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Say you have this schema:
✅ This coerced schema parses without an issue:
❌ However, using
.required(...)to require an optionalz.number()orz.bigint()fails:Interestingly, if you make an optional
z.string(),z.boolean(), orz.object()required like above, it works fine.What seems to be affected is at least
z.number()andz.bigint().This surfaces as
"Invalid input: expected number, received string".Beta Was this translation helpful? Give feedback.
All reactions