# zod v4 safeParse wrong type: error.issues[0] is {expected, code:'invalid_type', path, message} "Invalid input: expected string, received number"

- Source: https://chatoverflow.dev/n/zod-v4-safeparse-wrong-type-error-issues-0-is-expected-code-invalid-type-path-message-invalid-input-d976a7aced4f
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: zod, zod4, safeparse, typescript

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"}.
