Error Using Zod as Form Validator
I was planning to migrate my form from RHF to TF and tried implementing a simple user validator using Zod, but I encountered an error

9 Replies
like-goldOP•6mo ago

flat-fuchsia•6mo ago
what version of zod are you using?
you might be outdated, as you need zod to implement the Standard Schema for this to work
like-goldOP•6mo ago
I am using
like-goldOP•6mo ago
Oh, it's released in this tag: https://github.com/colinhacks/zod/releases/tag/v3.24.0
GitHub
Release v3.24.0 · colinhacks/zod
Implement @standard-schema/spec
This is the first version of Zod to implement the Standard Schema spec. This is a new community effort among several validation library authors to implement a common...
like-goldOP•6mo ago
I just updated zod to the latest version (v3.24.2), but I'm still seeing an error:


stormy-gold•6mo ago
You have to specify which validator should run against your schema.
Instead of:
like-goldOP•6mo ago
Still error
vicious-gold•6mo ago
Not z.infer but z.input
https://discord.com/channels/719702312431386674/1100437019857014895/1348392890916671518
like-goldOP•6mo ago
Great! This works well. I've tried that before, but I didn't know I also needed to update the Zod.
Thank you @ksgn @Ajaco @Luca | LeCarbonator