Title: Runtime injection does not instrument modules loaded by tsx on Node 24.13+ · Issue #24787 · getsentry/sentry-javascript · GitHub
Open Graph Title: Runtime injection does not instrument modules loaded by tsx on Node 24.13+ · Issue #24787 · getsentry/sentry-javascript
X Title: Runtime injection does not instrument modules loaded by tsx on Node 24.13+ · Issue #24787 · getsentry/sentry-javascript
Description: Follow up to #24343 From Node 24.13 / 25.1, registerDiagnosticsChannelInjection() in @sentry/server-runtime-injection registers Module.registerHooks({ resolve, load }) and, unlike the Module.register path for older Node versions, does no...
Open Graph Description: Follow up to #24343 From Node 24.13 / 25.1, registerDiagnosticsChannelInjection() in @sentry/server-runtime-injection registers Module.registerHooks({ resolve, load }) and, unlike the Module.regist...
X Description: Follow up to #24343 From Node 24.13 / 25.1, registerDiagnosticsChannelInjection() in @sentry/server-runtime-injection registers Module.registerHooks({ resolve, load }) and, unlike the Module.regist...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/24787
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Runtime injection does not instrument modules loaded by tsx on Node 24.13+","articleBody":"Follow up to #24343\n\nFrom Node 24.13 / 25.1, `registerDiagnosticsChannelInjection()` in `@sentry/server-runtime-injection` registers `Module.registerHooks({ resolve, load })` and, unlike the `Module.register` path for older Node versions, does not patch `Module.prototype._compile`. Runners that compile CommonJS themselves (`tsx`, `ts-node`) take over `require`, so the files they load never reach the sync `load` hook and stay uninstrumented.\n\nOn Node 24.21, a script that calls `Sentry.init()` and then requires `express` and `mysql` records `__SENTRY_ORCHESTRION__.runtime` as `[\"express\",\"express\"]` under plain `node`, and `[]` under `tsx`. Every user who runs their app with `tsx` or `ts-node` on Node 24.13+ loses channel-based spans today, for example the express route name on `http.server` segments.\n\nIn the `tsx-express` E2E app on Node 24.21, 8 of 10 tests failed: error events without the route segment, API route spans, MCP handler spans and all four tRPC tests.\n\nA first fix in #24343 (later removed from that PR) added the `_compile` patch on the `registerHooks` path. On its own it transforms every file twice when a plain `require` goes through both the sync hook and `_compile`, which records each module twice (`runtime=[\"dataloader\",\"dataloader\"]`) and broke the esbuild orchestrion suite and the Deno `@sentry/deno/import` tests. Skipping `_compile` for the files the sync hook already transformed fixed that, and the unit, esbuild and Deno suites passed with it.\n\nWhen this is fixed, remove the `volta.node` pin (`20.19.5`) from the `tsx-express` E2E app, which #24343 added so its E2E tests keep running on Node 20.\n","author":{"url":"https://github.com/JPeer264","@type":"Person","name":"JPeer264"},"datePublished":"2026-09-28T09:16:09Z","url":"https://github.com/getsentry/sentry-javascript/issues/24787"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9ebd5292-56fb-574e-565f-7bb9064a1308 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA30:339D75:BA4EA3:1051D98:6B043803 |
| html-safe-nonce | fd4077f7c453ce47d924baebfc5928e6e8c6aa779ebc2307242219a360cc3cf6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTMwOjMzOUQ3NTpCQTRFQTM6MTA1MUQ5ODo2QjA0MzgwMyIsInZpc2l0b3JfaWQiOiIyNzM1NzE0MDI1NTM0MTQyNDY3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7b399cddd4a320dbb6b0bf915cf8c31a1490f56791b34ca7d4974675446af558 |
| hovercard-subject-tag | issue:5612192954 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/24787/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4bd3519bf1806b9f8d76e8b8b87e9ba7c342b2d8d5933d38a6a2e177f7bbff43/getsentry/sentry-javascript/issues/24787 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4bd3519bf1806b9f8d76e8b8b87e9ba7c342b2d8d5933d38a6a2e177f7bbff43/getsentry/sentry-javascript/issues/24787 |
| og:image:alt | Follow up to #24343 From Node 24.13 / 25.1, registerDiagnosticsChannelInjection() in @sentry/server-runtime-injection registers Module.registerHooks({ resolve, load }) and, unlike the Module.regist... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JPeer264 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 06dc448a76fe4751ac1db26524aefa3aa3e889a8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width