Colin McDonnell
Colin McDonnell
In Zod 4, only `invalid_type` issues are considered "non-continuable". For other issue types (including the `invalid_format` issue produced by `z.iso.datetime()`) validation will continue (including across pipes) by default. You can...
Can you provide a minimal repro? It kind of looks like nothing was tree-shaken at all. I suggest trying `import * as z`
Thanks, looking into this.
Treeshaking is working for me in rollup and bundlejs.com: https://bundlejs.com/?q=zod%40next%2Fv4-mini&treeshake=%5B*%5D&text=%22const+result+%3D+z.string%28%29.safeParse%28%27asfd%27%29%3B%5Cnconsole.log%28result%29%3B%22&config=%7B%22analysis%22%3Atrue%7D It also seems to be working fine in your setup when I actually write the output to `dist/main.js`. So I'm...
Fixed in #4569, landed in https://github.com/colinhacks/zod/releases/tag/v3.25.42
RHF Resolvers v5.1.0 now requires `[email protected]+`. You'll see resolution errors if you're still on earlier versions of Zod. Most of the +1s on this issue are due to that. The...
This is documented in the changelog here:  Refinements now live inside schemas (this is also described in more detail in the announcement post) which means there's no easy way...
Generally accessing metadata inside the parsing path is an anti-pattern. Keep in mind that metadata data is attached to a specific *instance* and Zod methods return a new instance. This...
Perhaps something like this: ```ts const A = z.string().describe("name"); const B = A.superRefine((val, ctx) => { ctx.addIssue({ message: `Invalid ${A.description}`, }); }); B.parse("test"); // Should pass ```
In Zod 4, the original input is now available inside error maps, etc. ```ts z.date({ error: issue => issue.input === undefined ? "Required" : "Invalid date" }); ``` The `input`...