Johny
Johny3d ago

Zod Output validation failed

Hello, i'm using trpc and for some reason the return statement passes the type checks but at runtime it fails the zod validation, why?
3 Replies
Nick
Nick3d ago
Because your data and type are not the same I’d guess, it’s Zod’s job to check this
Johny
JohnyOP3d ago
Yea, but i'd assume typescript would check for that?
Nick
Nick3d ago
Only if the type is correct for your data, and potentially only if strict is on

Did you find this page helpful?