This repo demonstrates a problem when using a Zod 4 schema with a date
field in combination with Sveltekit Superforms and dateProxy
.
Issue: When submitting the form, the Zod 4 schema validation fails with:
Invalid input: expected date, received string
Comparison:
Date
.How to reproduce:
npm install && npm run dev
).Expected:
Submitting a valid date string should be accepted and converted to a Date
object for Zod 4, just like Zod 3.
The Zod 3 form is included below the Zod 4 form for comparison.