Title: Next.js `output: 'standalone'` records no server spans (orchestrion ESM loader hook is not traced) · Issue #23831 · getsentry/sentry-javascript · GitHub
Open Graph Title: Next.js `output: 'standalone'` records no server spans (orchestrion ESM loader hook is not traced) · Issue #23831 · getsentry/sentry-javascript
X Title: Next.js `output: 'standalone'` records no server spans (orchestrion ESM loader hook is not traced) · Issue #23831 · getsentry/sentry-javascript
Description: A Next.js app built with output: 'standalone' starts, serves pages, and records no server spans. The build is green and the server boots, so the only signal is a warning behind debug: true. Symptom On the standalone server with debug: tr...
Open Graph Description: A Next.js app built with output: 'standalone' starts, serves pages, and records no server spans. The build is green and the server boots, so the only signal is a warning behind debug: true. Symptom...
X Description: A Next.js app built with output: 'standalone' starts, serves pages, and records no server spans. The build is green and the server boots, so the only signal is a warning behind debug: true....
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/23831
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Next.js `output: 'standalone'` records no server spans (orchestrion ESM loader hook is not traced)","articleBody":"A Next.js app built with `output: 'standalone'` starts, serves pages, and records no server spans. The build is green and the server boots, so the only signal is a warning behind `debug: true`.\n\n## Symptom\n\nOn the standalone server with `debug: true`:\n\n```\nSentry Logger [warn]: Failed to register diagnostics-channel injection hooks;\nchannel-based integrations will not record spans.\nError: Cannot find module '.../.next/standalone/node_modules/.pnpm/@sentry+server-runtime-injection@.../\n @sentry/server-runtime-injection/build/esm/hook.js'\n```\n\nWithout `debug`, there is no signal at all.\n\n## Cause\n\n`register.ts` reaches the ESM loader hook with a runtime registration:\n\n```ts\nModule.register('@sentry/server-runtime-injection/hook', { parentURL });\n```\n\n`Module.register()` resolves its specifier at runtime, so `@vercel/nft` cannot see it and never traces the target file into the output. On the emitted build, the standalone copy of the package holds `build/cjs` only. The whole `build/esm` tree, including `hook.js`, is absent.\n\nRegistration runs inside a `try/catch`, so the SDK degrades instead of failing. The channel integrations replace the OpenTelemetry ones, so the result is no server spans rather than a fallback.\n\n## Scope\n\n- Reproduced on the webpack and the turbopack variant.\n- The package is correctly external here. This is not a bundling problem.\n- Docker and Vercel builds trace the same way, so they lose channel-based instrumentation too.\n- Same class of `@vercel/nft` blind spot as the meriyah `module-sync` issue patched in #23055.\n\n## Fix\n\nResolve the hook by a literal path relative to `register.js`, which tracers follow like any other dependency, with the bare self-reference kept as a fallback for a bundled copy. See #23687.\n\n---\n\nInternal tracking: [JS-3451](https://linear.app/getsentry/issue/JS-3451)\n","author":{"url":"https://github.com/andreiborza","@type":"Person","name":"andreiborza"},"datePublished":"2026-09-01T11:59:18Z","url":"https://github.com/getsentry/sentry-javascript/issues/23831"}
| 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:587a8d8b-f88a-9fb1-5d7f-8effcc9ffbe4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A498:212AFB:B5150C:F8AED7:6B0455E0 |
| html-safe-nonce | 7a6e46ff0a0ce4fe9eef01a440311a6bfd25d51c5210edfb8658024d89356b52 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDk4OjIxMkFGQjpCNTE1MEM6RjhBRUQ3OjZCMDQ1NUUwIiwidmlzaXRvcl9pZCI6IjU4ODYzNzkxNjM0NTUzNDYxNDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 00d2b442f48b4cf19174329b1167415dca4bbb16f7ca06a44950ff07b9e2d2cd |
| hovercard-subject-tag | issue:5311533161 |
| 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/23831/issue_layout |
| twitter:image | https://opengraph.githubassets.com/741e111d7268d788e2549de1e81f8e1accdb6b944aeaf81efab74c52f5f32892/getsentry/sentry-javascript/issues/23831 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/741e111d7268d788e2549de1e81f8e1accdb6b944aeaf81efab74c52f5f32892/getsentry/sentry-javascript/issues/23831 |
| og:image:alt | A Next.js app built with output: 'standalone' starts, serves pages, and records no server spans. The build is green and the server boots, so the only signal is a warning behind debug: true. Symptom... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andreiborza |
| hostname | github.com |
| expected-hostname | github.com |
| None | 910ca0e260cfec6aff11407d8dc6a0d3a4cd381a2ec9ada56627b063426892a0 |
| 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 | e086f9b7e88322eb2b41885a6ad425b215737fa5 |
| 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