chore(repo): upgrade monorepo to Node.js 24#8351
Conversation
- Update root package.json engines to require Node >=24.15.0 - Update .nvmrc to Node 24.15.0 - Update CI workflows to use Node 24 as primary version - Add Node 20 to CI test matrix for published package compatibility - Update release workflow caching to Node 24 Published packages maintain Node >=20.9.0 compatibility as specified in their individual engines fields. This change only affects the monorepo development environment and CI/CD pipelines.
🦋 Changeset detectedLatest commit: a14d934 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughUpdated Node.js target from 22.x to 24.15.0 across project configs and CI: Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
|
Deployment failed with the following error: View Documentation: https://vercel.com/docs/two-factor-authentication |
- Bump default node-version in init actions from 22 to 24 so integration-tests run on the version required by engines.node - In ClerkRequest, build init explicitly when cloning a Request to avoid undici extracting a cross-realm signal (e.g. from NextRequest), which Node 24's stricter instanceof check rejects - Also fixes a latent precedence bug where a provided init was silently dropped
- Pin node-version to 24.15.0 in init actions, matrix, and pkg-pr-new step so the engines.node check (>=24.15.0) is satisfied - Use a Proxy to intercept the 'signal' read when cloning a Request, instead of eagerly reading individual properties (which broke in environments like Cloudflare Workers where Request.cache is not implemented)
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 221-224: CI matrix includes an unsupported "node-version: 20"
entry; remove that entry so the matrix only contains the supported
"node-version: 24.15.0". Edit the matrix block that lists the node-version
values (the YAML key "node-version" in the job matrix) and delete the line with
"20", leaving the existing "24.15.0" (and keep "test-filter" and "filter-label"
entries unchanged); verify no other job or matrix elsewhere still references
node 20.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 4d516f8e-f4a5-4b0a-a1fa-a36126cee8dc
📒 Files selected for processing (4)
.github/actions/init-blacksmith/action.yml.github/actions/init/action.yml.github/workflows/ci.ymlpackages/backend/src/tokens/clerkRequest.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- .github/actions/init-blacksmith/action.yml
- .github/actions/init/action.yml
- packages/backend/src/tokens/clerkRequest.ts
| - node-version: 24.15.0 | ||
| test-filter: "**" | ||
| filter-label: "**" | ||
| - node-version: 20 |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "CI matrix node versions:"
rg -n -C2 'node-version:' .github/workflows/ci.yml
echo
echo "Repo engine + local Node baseline:"
rg -n '"node":\s*">=24\.15\.0"' package.json
sed -n '1,5p' .nvmrc
echo
echo "Verify init action wiring for node-version input:"
fd -i 'action.yml' .github/actions/init-blacksmith --exec rg -n -C2 'inputs:|node-version|setup-node' {}Repository: clerk/javascript
Length of output: 1501
🏁 Script executed:
cat package.json | head -20Repository: clerk/javascript
Length of output: 1266
🏁 Script executed:
# Search for any documentation about Node version support
fd -i 'readme|contributing' --type f | head -5 | xargs grep -l -i 'node' 2>/dev/null || echo "No matches in readme files"Repository: clerk/javascript
Length of output: 108
🏁 Script executed:
# Check if there are any comments or issues in the workflow itself about Node 20 support
rg -B5 -A5 'node-version: 20' .github/workflows/ci.ymlRepository: clerk/javascript
Length of output: 315
🏁 Script executed:
cat docs/CONTRIBUTING.md | grep -i -A5 -B5 'node\|version' | head -40Repository: clerk/javascript
Length of output: 1880
Remove Node 20 from the CI matrix—it falls below the minimum supported version
The CI matrix tests node-version: 20 (line 224), but the repository's minimum supported version is 24.15.0, as declared in package.json ("node": ">=24.15.0") and documented in .nvmrc and CONTRIBUTING.md. Node 20 does not meet this requirement and should be removed from the matrix entirely.
Proposed change
- node-version: 24.15.0
test-filter: "**"
filter-label: "**"
- - node-version: 20
- test-filter: "**"
- filter-label: "**"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - node-version: 24.15.0 | |
| test-filter: "**" | |
| filter-label: "**" | |
| - node-version: 20 | |
| - node-version: 24.15.0 | |
| test-filter: "**" | |
| filter-label: "**" |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/ci.yml around lines 221 - 224, CI matrix includes an
unsupported "node-version: 20" entry; remove that entry so the matrix only
contains the supported "node-version: 24.15.0". Edit the matrix block that lists
the node-version values (the YAML key "node-version" in the job matrix) and
delete the line with "20", leaving the existing "24.15.0" (and keep
"test-filter" and "filter-label" entries unchanged); verify no other job or
matrix elsewhere still references node 20.
There was a problem hiding this comment.
Keeping the Node 20 entry intentionally — every published package still declares "engines": { "node": ">=20.9.0" }, so testing against the lowest supported runtime catches regressions for consumers on Node 20. The root >=24.15.0 is a dev/build requirement only, and engine-strict=false in .npmrc lets pnpm install proceed regardless. Pinned the matrix to 20.9.0 exactly so we're testing the actual minimum supported version.
There was a problem hiding this comment.
@jacekradko, that makes complete sense — thank you for the clarification. The distinction between the root engines.node (a dev/build tooling requirement) and the individual published packages' engines.node (the consumer-facing minimum) is an important one, and I missed it. Testing against Node 20.9.0 in CI is exactly the right way to guard against regressions for downstream consumers on the lowest supported runtime. I'll update my understanding for future reviews.
✏️ Learnings added
Learnt from: jacekradko
Repo: clerk/javascript PR: 8351
File: .github/workflows/ci.yml:0-0
Timestamp: 2026-04-23T02:41:47.066Z
Learning: In the clerk/javascript monorepo, the root `package.json` `engines.node` (currently `>=24.15.0`) is a dev/build tooling requirement only. Individual published packages declare their own `engines.node` (currently `>=20.9.0`), which represents the minimum supported consumer runtime. The CI `unit-tests` matrix intentionally includes Node 20.9.0 to catch regressions for consumers on the lowest supported version. `engine-strict=false` in `.npmrc` allows pnpm install to proceed regardless of engine version. Do not flag Node 20.x CI matrix entries as unsupported — they are testing published-package consumer compatibility, not the dev environment requirement.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
Summary
Changes
package.jsonengines to require Node ≥24.15.0.nvmrcto Node 24.15.0Test plan