You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs: error message example in README doesn't match actual output #6589
The 'Handling errors' section of packages/zod/README.md shows the Zod Error. issues messages as 'Invalid input: expected string' and 'Invalid input: expected number'. Running the exact example against the published package (zod 4.6.2) actually produces 'Invalid input: expected string, received number' and 'Invalid input: expected number, received string' — both messages are missing the ', received X' suffix. I have a two-line fix ready and a branch pushed to my fork (phebiannwokeji-cmd/zod, branch patch-1) if that's useful, but wanted to open this first per the CONTRIBUTING guide.
good-idea — the report is correct and actionable. I reproduced the mismatch against both current main and published zod@4.6.2; the similarity candidates concern different error-reporting behavior, so this is not a duplicate.
import*aszfrom"zod";constPlayer=z.object({username: z.string(),xp: z.number(),});constresult=Player.safeParse({username: 42,xp: "100"});if(!result.success){result.error.issues.map((issue)=>issue.message);// actual: [// "Invalid input: expected string, received number",// "Invalid input: expected number, received string",// ]// README currently omits both `, received …` suffixes.}
Plan:
Update the two message strings in packages/zod/README.md so they include , received number and , received string. The root README.md is a symlink to this file, so no second edit is needed.
Rerun the exact example against current source and compare the documented issue objects with the runtime output. This is documentation-only, and the repository does not execute README code blocks, so no implementation or test-suite changes are needed.
No implementation was started. The detailed triage record is in .triage/issues/6589/results.md.
The same stale strings were on the Basics docs page too, and the Zod Mini tab needed a different value again — @zod/mini ships without the en locale, so it emits a bare Invalid input until you configure one. Six occurrences in total, so I took it directly rather than have you chase them all down.
Activity
pullfrog commentedon Sep 11, 2026
good-idea— the report is correct and actionable. I reproduced the mismatch against both currentmainand publishedzod@4.6.2; the similarity candidates concern different error-reporting behavior, so this is not a duplicate.Plan:
messagestrings inpackages/zod/README.mdso they include, received numberand, received string. The rootREADME.mdis a symlink to this file, so no second edit is needed.No implementation was started. The detailed triage record is in
.triage/issues/6589/results.md.GPT Sol| 𝕏colinhacks commentedon Sep 11, 2026
Good catch. Fixed in 46da957.
The same stale strings were on the Basics docs page too, and the Zod Mini tab needed a different value again —
@zod/miniships without theenlocale, so it emits a bareInvalid inputuntil you configure one. Six occurrences in total, so I took it directly rather than have you chase them all down.Thanks for the report! 👍
docs: match the error-message examples to what the parsers emit