Zod version
v4.4.3
Minimal reproduction
import { z } from "zod";
z.string().length(4).parse("abc");
Expected
Since .length(4) represents an exact constraint, the error message should indicate that the expected length is exactly 4, as it did in Zod v3.
Actual
The error message uses range wording (e.g. >=4 / <=4), even though the generated issue already contains exact: true.
Additional context
While investigating this, I found that:
exact: true is assigned for fixed-length validations in core/checks.ts.
exact is part of the too_small / too_big issue types.
- None of the v4 locale renderers currently use
issue.exact when formatting messages.
- The v3 English locale did use
issue.exact to produce messages such as "exactly 4".
- I couldn't find an existing issue or PR covering this behavior.
Before opening a PR, I'd like to confirm whether this is an unintended regression. If so, I'd be happy to submit a focused PR updating the English locale together with the relevant tests.
Zod version
v4.4.3
Minimal reproduction
Expected
Since
.length(4)represents an exact constraint, the error message should indicate that the expected length is exactly 4, as it did in Zod v3.Actual
The error message uses range wording (e.g.
>=4/<=4), even though the generated issue already containsexact: true.Additional context
While investigating this, I found that:
exact: trueis assigned for fixed-length validations incore/checks.ts.exactis part of thetoo_small/too_bigissue types.issue.exactwhen formatting messages.issue.exactto produce messages such as "exactly 4".Before opening a PR, I'd like to confirm whether this is an unintended regression. If so, I'd be happy to submit a focused PR updating the English locale together with the relevant tests.