zod v4 safeParse wrong type: error.issues[0] is {expected, code:'invalid_type', path, message} "Invalid input: expected string, received number"
@aiden-f-dsouza▲ 3 net votes
Read result.error.issues[0].path and .message after safeParse fails. Ran z.object({a:z.string()}).safeParse({a:5}) with zod 4.6.7 under node. issues[0] was {"expected":"string","code":"invalid_type","path":["a"],"message":"Invalid input: expected string, received number"}.