Skip to content

Fix $ZodErrorTree type: Allow undefined in error items array #4040

Fix $ZodErrorTree type: Allow undefined in error items array

Fix $ZodErrorTree type: Allow undefined in error items array #4040

Triggered via pull request January 12, 2026 19:06
Status Failure
Total duration 1m 15s
Artifacts

test.yml

on: pull_request
Check for circular dependencies
23s
Check for circular dependencies
Matrix: lint
Matrix: test-node
Fit to window
Zoom out
Zoom in

Annotations

5 errors
Test with TypeScript latest on Node lts/* (ubuntu-latest)
Process completed with exit code 1.
src/v4/classic/tests/error-utils.test.ts: packages/zod/src/v4/classic/tests/error-utils.test.ts#L341
TypeCheckError: Type '{ errors string[]; properties? { username? { errors string[]; }; favoriteNumbers? { errors string[]; items? { errors string[]; }[]; }; nesting? { errors string[]; properties? { a? { errors string[]; }; }; }; }; }' does not satisfy the constraint '{ errors string[]; properties "Expected undefined, Actual ..." | "Expected ..., Actual ..."; }'. Types of property 'properties' are incompatible. Type '{ username? { errors string[]; }; favoriteNumbers? { errors string[]; items? { errors string[]; }[]; }; nesting? { errors string[]; properties? { a? { errors string[]; }; }; }; }' is not assignable to type '"Expected undefined, Actual ..." | "Expected ..., Actual ..."'. ❯ src/v4/classic/tests/error-utils.test.ts:341:34
Test with TypeScript 5.5 on Node lts/* (ubuntu-latest)
The strategy configuration was canceled because "test-node.ubuntu-latest_lts___lates" failed
Test with TypeScript 5.5 on Node lts/* (ubuntu-latest)
Process completed with exit code 1.
src/v4/classic/tests/error-utils.test.ts: packages/zod/src/v4/classic/tests/error-utils.test.ts#L341
TypeCheckError: Type '{ errors string[]; properties? { username? { errors string[]; }; favoriteNumbers? { errors string[]; items? { errors string[]; }[]; }; nesting? { errors string[]; properties? { a? { errors string[]; }; }; }; }; }' does not satisfy the constraint '{ errors string[]; properties "Expected undefined, Actual ..." | "Expected ..., Actual ..."; }'. Types of property 'properties' are incompatible. Type '{ username? { errors string[]; }; favoriteNumbers? { errors string[]; items? { errors string[]; }[]; }; nesting? { errors string[]; properties? { a? { errors string[]; }; }; }; }' is not assignable to type '"Expected undefined, Actual ..." | "Expected ..., Actual ..."'. ❯ src/v4/classic/tests/error-utils.test.ts:341:34