Skip to content

feat: Support Node 24 #16236

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

Merged
merged 4 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [18, 20, 22]
node: [18, 20, 22, 24]
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v4
Expand Down Expand Up @@ -713,12 +713,12 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['18.20.5', 20, 22]
node: ['18.20.5', 20, 22, 24]
typescript:
- false
include:
# Only check typescript for latest version (to streamline CI)
- node: 22
- node: 24
typescript: '3.8'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
Expand Down
2 changes: 1 addition & 1 deletion packages/profiling-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"test:watch": "vitest --watch"
},
"dependencies": {
"@sentry-internal/node-cpu-profiler": "^2.0.0",
"@sentry-internal/node-cpu-profiler": "^2.2.0",
"@sentry/core": "9.17.0",
"@sentry/node": "9.17.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/profiling-node/src/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,12 +632,12 @@ class ContinuousProfiler {

/** Exported only for tests. */
export const _nodeProfilingIntegration = ((): ProfilingIntegration<NodeClient> => {
if (![16, 18, 20, 22].includes(NODE_MAJOR)) {
if (![16, 18, 20, 22, 24].includes(NODE_MAJOR)) {
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn(
`[Sentry Profiling] You are using a Node.js version that does not have prebuilt binaries (${NODE_VERSION}).`,
'The @sentry/profiling-node package only has prebuilt support for the following LTS versions of Node.js: 16, 18, 20, 22.',
'The @sentry/profiling-node package only has prebuilt support for the following LTS versions of Node.js: 16, 18, 20, 22, 24.',
'To use the @sentry/profiling-node package with this version of Node.js, you will need to compile the native addon from source.',
'See: https://github.com/getsentry/sentry-javascript/tree/develop/packages/profiling-node#building-the-package-from-source',
);
Expand Down
8 changes: 7 additions & 1 deletion scripts/ci-unit-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as path from 'path';

const UNIT_TEST_ENV = process.env.UNIT_TEST_ENV as 'node' | 'browser' | undefined;
const RUN_AFFECTED = process.argv.includes('--affected');
const NODE_VERSION = process.env.NODE_VERSION as '18' | '20' | '22';
const NODE_VERSION = process.env.NODE_VERSION as '18' | '20' | '22' | '24';

// These packages are tested separately in CI, so no need to run them here
const DEFAULT_SKIP_PACKAGES = ['@sentry/bun', '@sentry/deno'];
Expand All @@ -29,6 +29,8 @@ const BROWSER_TEST_PACKAGES = [
// Packages that cannot run in Node 18
const SKIP_NODE_18_PACKAGES = ['@sentry/react-router'];

const SKIP_NODE_24_PACKAGES = ['@sentry/google-cloud-serverless'];

function getAllPackages(): string[] {
const { workspaces }: { workspaces: string[] } = JSON.parse(
fs.readFileSync(path.join(process.cwd(), 'package.json'), 'utf-8'),
Expand Down Expand Up @@ -63,6 +65,10 @@ function runTests(): void {
if (NODE_VERSION === '18') {
SKIP_NODE_18_PACKAGES.forEach(pkg => ignores.add(pkg));
}

if (NODE_VERSION === '24') {
SKIP_NODE_24_PACKAGES.forEach(pkg => ignores.add(pkg));
}
}

if (RUN_AFFECTED) {
Expand Down
28 changes: 14 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6394,13 +6394,13 @@
"@angular-devkit/schematics" "14.2.13"
jsonc-parser "3.1.0"

"@sentry-internal/node-cpu-profiler@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/node-cpu-profiler/-/node-cpu-profiler-2.0.0.tgz#76a0d363055876b91663769daee2d4b12321ba3b"
integrity sha512-0pZId+HY/AbNs1+CoCi8wogBWTrRv+DYeOgbevhekzMr5HYsA6PRY21NtHBXMbu0WcswFwaveDKR+sOW1EDHAA==
"@sentry-internal/node-cpu-profiler@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/node-cpu-profiler/-/node-cpu-profiler-2.2.0.tgz#0640d4aebb4d36031658ccff83dc22b76f437ede"
integrity sha512-oLHVYurqZfADPh5hvmQYS5qx8t0UZzT2u6+/68VXsFruQEOnYJTODKgU3BVLmemRs3WE6kCJjPeFdHVYOQGSzQ==
dependencies:
detect-libc "^2.0.2"
node-abi "^3.61.0"
detect-libc "^2.0.3"
node-abi "^3.73.0"

"@sentry-internal/[email protected]":
version "2.34.0"
Expand Down Expand Up @@ -13212,10 +13212,10 @@ detect-libc@^1.0.3:
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==

detect-libc@^2.0.0, detect-libc@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.2.tgz#8ccf2ba9315350e1241b88d0ac3b0e1fbd99605d"
integrity sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==
detect-libc@^2.0.0, detect-libc@^2.0.2, detect-libc@^2.0.3:
version "2.0.4"
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.4.tgz#f04715b8ba815e53b4d8109655b6508a6865a7e8"
integrity sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==

[email protected]:
version "3.1.0"
Expand Down Expand Up @@ -21606,10 +21606,10 @@ nock@^13.5.5:
json-stringify-safe "^5.0.1"
propagate "^2.0.0"

node-abi@^3.3.0, node-abi@^3.61.0:
version "3.61.0"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.61.0.tgz#9248f8b8e35dbae2fafeecd6240c5a017ea23f3f"
integrity sha512-dYDO1rxzvMXjEMi37PBeFuYgwh3QZpsw/jt+qOmnRSwiV4z4c+OLoRlTa3V8ID4TrkSQpzCVc9OI2sstFaINfQ==
node-abi@^3.3.0, node-abi@^3.73.0:
version "3.75.0"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.75.0.tgz#2f929a91a90a0d02b325c43731314802357ed764"
integrity sha512-OhYaY5sDsIka7H7AtijtI9jwGYLyl29eQn/W623DiN/MIv5sUqc4g7BIDThX+gb7di9f6xK02nkp8sdfFWZLTg==
dependencies:
semver "^7.3.5"

Expand Down
Loading