Johny
Johny4mo 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
Nick4mo ago
Because your data and type are not the same I’d guess, it’s Zod’s job to check this
Johny
JohnyOP4mo ago
Yea, but i'd assume typescript would check for that?
Nick
Nick4mo ago
Only if the type is correct for your data, and potentially only if strict is on

Did you find this page helpful?