-
Notifications
You must be signed in to change notification settings - Fork 1
fix: update to node 22 #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughBumped Node.js from 20 to 22 (.nvmrc and package.json), added Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant GH as GitHub Actions
participant Job as CI Job
participant Container as Docker Container (node:20-bullseye)
participant Runner as GitHub-hosted runner (ubuntu-latest)
note over GH,Job #D6EAF8: Previous flow (before)
GH->>Container: start container
Container->>Job: run job steps (setup-node, install, lint, typecheck, test)
Note right of Job: Node provided by container image
par Updated flow (after)
GH->>Runner: start ubuntu-latest runner
Runner->>Job: run job steps (setup-node, install, lint, typecheck, test)
Note right of Job: Node provided by setup-node using .nvmrc
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
package.json (2)
1-14: Add engines to enforce Node 22 across environments.This prevents accidental installs/builds on Node 20 or 23 that may pass locally but fail in CI/CD.
Proposed diff (insert after "type"):
"type": "module", + "engines": { + "node": ">=22 <23" + },
1-14: Optionally pin via Volta if your team uses it.If Volta is part of your toolchain, adding it will auto-install/enforce Node 22 for contributors.
"type": "module", + "volta": { + "node": "22.##" + },Replace ## with the chosen patch if you decide to pin.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (2)
.nvmrc(1 hunks)package.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Deploy Preview
- GitHub Check: Install Lint Type-check
🔇 Additional comments (2)
.nvmrc (1)
1-1: Node 22 is correctly sourced from .nvmrc in CI
All GitHub Actions workflows (.github/workflows/ci.yml,preview.yml,production.yml) useactions/setup-node@v3withnode-version-file: '.nvmrc', so bumping to Node 22 in.nvmrcis picked up automatically.package.json (1)
53-53: Node types v22 upgrade: configuration looks correcttsconfig.json (for
src) includes:
- lib: ["ES2020", "DOM", "DOM.Iterable"]
- no
"types"override (so all@types/*packages—including@types/node—are loaded)skipLibCheck: truesuppresses lib conflictstsconfig.node.json only applies to tooling (
vite.config.ts), so browser code is unaffected by Node-only ts settings. No@types/nodeimports found undersrc/.Action items (optional):
- Ensure you’re not inadvertently using Node globals (e.g.,
fetch,WebSocket) that shadow the DOM versions.- If you need stricter separation, you can add a
"types": []entry in yourtsconfig.json(or maintain a separate tsconfig for Node).All good to approve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
.github/workflows/ci.yml(0 hunks)package.json(2 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/ci.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Deploy Preview
🔇 Additional comments (1)
package.json (1)
6-8: Allow Node 23 by widening the engines rangeThe lock “node”: "22.x" will prevent anyone using Node 23—even though it’s been verified to work locally. Since your .nvmrc is pinned to “22”, CI and other automation will stay on Node 22 while allowing Node 23 for contributors.
Update package.json as follows:
- "engines": { - "node": "22.x" - }, + "engines": { + "node": ">=22 <24" + },
| "@types/mixpanel-browser": "^2.48.1", | ||
| "@types/multicoin-address-validator": "^0", | ||
| "@types/node": "^20.10.7", | ||
| "@types/node": "^22.13.14", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Bumping @types/node to ^22.13.14: check TS compatibility and potential DOM/Undici type collisions.
Type packages for Node 22 may surface new globals (fetch, Request, Response via undici-types). With TypeScript at ^5.2.2 and DOM libs enabled, projects sometimes hit duplicate identifier issues. Ensure type-check passes without relying on skipLibCheck.
If you encounter issues:
- Option A (preferred): bump TypeScript to a newer minor (e.g., ^5.6) that aligns well with modern lib typings.
- Option B: adjust tsconfig libs to avoid conflicting DOM globals if not needed, or enable "skipLibCheck": true as a fallback.
Verification aide:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Typescript & @types/node versions:"
jq -r '.devDependencies | {typescript, "@types/node"}' package.json
echo
echo "Check for tsconfig lib and skipLibCheck (may appear in multiple tsconfigs):"
fd -a tsconfig*.json | while read -r f; do
echo "----- $f"
rg -n -C1 -P '"lib"\s*:|\bskipLibCheck\b' "$f" || true
done
echo
echo "Scan for common collision indicators (Request/Response/fetch in global usage):"
rg -n -C2 -P '\b(fetch|Request|Response|Headers)\b' --type=ts --type=tsx -g '!**/node_modules/**' || trueLength of output: 555
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Detected tsconfig files:"
fd -g 'tsconfig*.json' || true
echo
echo "Checking tsconfig files for 'lib' entries and skipLibCheck:"
fd -g 'tsconfig*.json' | while read -r file; do
echo "----- $file -----"
rg -n -C1 -P '"lib"\s*:|\bskipLibCheck\b' "$file" || true
done
echo
echo "Scanning TS/TSX sources for global fetch|Request|Response|Headers usage:"
rg -n -C2 -P '\b(fetch|Request|Response|Headers)\b' --type ts --type tsx -g '!**/node_modules/**' || trueLength of output: 1390
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Scanning TS/TSX sources for global fetch|Request|Response|Headers usage without relying on --type:"
rg -n -C2 -P '\b(fetch|Request|Response|Headers)\b' -g '*.ts' -g '*.tsx' -g '!**/node_modules/**' || trueLength of output: 1569
skipLibCheck suppresses Node 22/DOM type collisions
Your tsconfig files—tsconfig.json, tsconfig.node.json, and scripts/tsconfig.json—all have "skipLibCheck": true, and tsconfig.json includes ["ES2020", "DOM", "DOM.Iterable"], so any duplicate globals (fetch, Request, Response, Headers from undici-types vs. DOM) are currently ignored. If you ever disable skipLibCheck or run a stricter type-check and hit conflicts, consider:
- Option A (preferred): bump TypeScript to a newer minor (e.g.,
^5.6) that aligns with modern lib typings - Option B: remove
"DOM"/"DOM.Iterable"from tsconfig.json if browser globals aren’t needed in your Node build - Option C: keep
"skipLibCheck": trueas a fallback
🤖 Prompt for AI Agents
In package.json around line 56, the project pins @types/node ^22 while tsconfigs
use skipLibCheck and include DOM libs which can cause duplicate global type
collisions if skipLibCheck is removed; update the TypeScript devDependency to a
newer minor (e.g., bump "typescript" to ^5.6) as the preferred fix so lib
typings align, or alternatively remove "DOM"/"DOM.Iterable" from tsconfig.json
if browser globals are unnecessary for Node, or keep "skipLibCheck": true as a
last-resort fallback; implement the preferred bump in package.json and run a
full type-check to confirm conflicts are resolved.
Description
Says what it does, update the CI to node 22 and types
Issue (if applicable)
closes #10305
Risk
Medium, I've always been using node 23 and it seems to work as expected, but we need to check if the deployment and build works fine from the CI
Testing
Engineering
Operations
Screenshots (if applicable)
Nothing to show here really
Summary by CodeRabbit