feat(validations): adopt the richer error formatting from apify-client - #703
Merged
Conversation
vladfrangu
approved these changes
Sep 7, 2026
This was referenced Sep 7, 2026
B4nan
added a commit
to apify/apify-sdk-js
that referenced
this pull request
Sep 7, 2026
Bumps `@apify/validations` to 1.1.0 (the richer error formatting upstreamed from apify-client in apify/apify-shared-js#703) and `@apify/input_secrets` to 2.0.3, and unifies zod on a single 4.5.4 resolution. Without the zod dedupe the new validations resolves its own newer zod instance next to the pinned one, and the two zod type identities do not unify (this broke the build in the crawlee counterpart PR).
B4nan
added a commit
to apify/apify-client-js
that referenced
this pull request
Sep 7, 2026
Bumps the `@apify/*` shared packages to the new stable majors (ESM-only, Node 22+, matching the v3 requirements): `consts`, `log` and `utilities` to v3. Replaces the Renovate PRs (#1020, #1021, #1022) that target master, where the ESM-only majors cannot land. The vendored zod error formatter and its test suite moved to `@apify/validations` (apify/apify-shared-js#703, released as 1.1.0), so this now depends on it and re-exports `ArgumentValidationError` from there. The shared formatter keeps all of the client's improvements and its message shapes follow the crawlee style, which no client test pinned outside the moved suite.
vdusek
pushed a commit
to apify/apify-client-js
that referenced
this pull request
Sep 8, 2026
Bumps the `@apify/*` shared packages to the new stable majors (ESM-only, Node 22+, matching the v3 requirements): `consts`, `log` and `utilities` to v3. Replaces the Renovate PRs (#1020, #1021, #1022) that target master, where the ESM-only majors cannot land. The vendored zod error formatter and its test suite moved to `@apify/validations` (apify/apify-shared-js#703, released as 1.1.0), so this now depends on it and re-exports `ArgumentValidationError` from there. The shared formatter keeps all of the client's improvements and its message shapes follow the crawlee style, which no client test pinned outside the moved suite.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
apify-client's vendored copy of this formatter grew several improvements the shared package lacked, and this brings them over so the client can drop its copy: messages cap at 10 issue lines with an "... and N more problems" tail (a failed dataset push otherwise renders every element), failed unions report only the deepest-failing arms, zod's self-contradictory sentences get corrected ("expected number, received number" for Infinity/NaN becomes "expected a finite number", similar for invalid Dates), bigints render with their
nsuffix, and parsing pins the English locale so messages stay stable under a global zod locale.Message shapes stay as crawlee and the SDK pin them in tests. The package also gains a test suite (ported from both consumers); it had none. The changed messages are technically breaking, but the only consumers are crawlee v4, SDK v4 and client v3, all unreleased, so this ships as a non-breaking commit.