chore!: require Node.js 22 or newer - #984
Open
vdusek wants to merge 6 commits into
Open
Conversation
Matches the Crawlee v4 floor. `apify-client` sits below `@crawlee/core` in the dependency graph, so its minimum must not be higher than Crawlee's, and there is no reason for it to be lower. - Add `engines.node: ">=22.0.0"`. - Drop Node 20 from the CI test matrix. - Move tsc to `NodeNext` module/moduleResolution and an ES2024 target and lib. - Remove the brotli-availability guard and its gzip fallback, which existed only for Node.js < 10.16.0. BREAKING CHANGE: Node.js 18 and 20 are no longer supported. The minimum supported version is now Node.js 22.
The script has been failing for a while and is not wired into CI, so the errors went unnoticed. - Set `declaration: false` in `test/tsconfig.json`. The project is `noEmit`, but it inherited `declaration: true` from `@apify/tsconfig`, so it reported declaration-emit portability errors (TS2883 on the express-based mock server, TS9005 on the generated browser bundle) for output that is never written. - Drop the unused `vi` import in `test/utils.test.ts` (TS6133). - Widen the too-strict `[string]` tuple annotation in `test/runs.test.ts` to match vitest's `mock.calls` element type (TS2345).
B4nan
reviewed
Jul 31, 2026
| fail-fast: false | ||
| matrix: | ||
| node-version: [20, 22, 24] | ||
| node-version: [22, 24] |
Member
There was a problem hiding this comment.
Suggested change
| node-version: [22, 24] | |
| node-version: [22, 24, 26] |
| } | ||
|
|
||
| let gzipPromisified: ((arg: string | Buffer<ArrayBufferLike>) => Promise<Buffer>) | undefined; | ||
| let brotliCompressPromisified: ((arg: string | Buffer<ArrayBufferLike>) => Promise<Buffer>) | undefined; |
Member
There was a problem hiding this comment.
isnt this all unrelated to the nodejs bump?
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.
Raises the minimum supported Node.js version to 22, matching the Crawlee v4 floor.
apify-clientsits below@crawlee/core, so its minimum must not be higher than Crawlee's, and there is no reason for it to be lower.package.json— addedengines: { "node": ">=22.0.0" }.check.yaml—build_and_testmatrix[20, 22, 24]->[22, 24].tsconfig.json—moduleNode16->node20,moduleResolution->nodenext,lib->["ES2024", "DOM"],target: "ES2024". ES2024 rather than Crawlee'sESNext, because Node 22 does not implement ES2025 syntax such asusing.src/utils.ts— replaced a brotli-availability guard commented as a Node.js < v10.16.0 workaround with atry/catch. The gzip fallback stays, but is now keyed on compression actually failing rather than on the Node version, which also covers runtimes with a partialnode:zlib.docs/01_introduction/index.mdandCONTRIBUTING.md.website/versioned_docs/version-2/**is untouched, as it is a frozen v2 snapshot.Drive-by:
pnpm tsc-check-testswas already failing onv3, mostly withTS1541from the oldmodule: Node16. Nothing ran it in CI, so it went unnoticed; it is fixed and now part of thelintjob.BREAKING CHANGE: Node.js 18 and 20 are no longer supported. The minimum supported version is now Node.js 22.
✍️ Drafted by Claude Code