Title: `@sentry/react-router` 11: build-time instrumentation inlines CommonJS that default-imports `@sentry/core`; server crashes at startup · Issue #25339 · getsentry/sentry-javascript · GitHub
Open Graph Title: `@sentry/react-router` 11: build-time instrumentation inlines CommonJS that default-imports `@sentry/core`; server crashes at startup · Issue #25339 · getsentry/sentry-javascript
X Title: `@sentry/react-router` 11: build-time instrumentation inlines CommonJS that default-imports `@sentry/core`; server crashes at startup · Issue #25339 · getsentry/sentry-javascript
Description: This issue was written with Claude Opus 5.5 (Anthropic) and reviewed by a human before it was filed. Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have rev...
Open Graph Description: This issue was written with Claude Opus 5.5 (Anthropic) and reviewed by a human before it was filed. Is there an existing issue for this? I have checked for existing issues https://github.com/getse...
X Description: This issue was written with Claude Opus 5.5 (Anthropic) and reviewed by a human before it was filed. Is there an existing issue for this? I have checked for existing issues https://github.com/getse...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/25339
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`@sentry/react-router` 11: build-time instrumentation inlines CommonJS that default-imports `@sentry/core`; server crashes at startup","articleBody":"_This issue was written with Claude Opus 5.5 (Anthropic) and reviewed by a human before it was filed._\n\n### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/react-router\n\n### SDK Version\n\n11.7.0\n\n### Framework Version\n\nReact Router 7.18.4 (framework mode, custom Express server); also reproduced on React Router 8.4.0. Vite 7.3.7, Node.js 22.23.3.\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\n`vite.config.ts` adds the Sentry plugin only for production builds that have an auth token, and does not set `buildTimeInstrumentation`:\n\n```ts\nsentryReactRouter(\n {\n org: \"\u003corg>\",\n project: \"\u003cproject>\",\n authToken: process.env.SENTRY_AUTH_TOKEN,\n telemetry: false,\n release: process.env.SENTRY_RELEASE ? { name: process.env.SENTRY_RELEASE } : undefined,\n },\n config,\n),\n```\n\nSentry is initialised before the app via `NODE_OPTIONS='--import ./instrument.server.mjs'` (`Sentry.init` from `@sentry/react-router`, plus `nodeProfilingIntegration`). The server then loads the build with `await import(\"./build/server/index.js\")`.\n\n### Steps to Reproduce\n\n1. Build with `SENTRY_AUTH_TOKEN` set and `NODE_ENV` unset (our CI Docker build). `sentryReactRouter` then adds `sentryOrchestrionPlugin`.\n2. Start the server: `node --import ./instrument.server.mjs server.js`.\n\nWe reproduced this deterministically in our app, locally and in production. We have not built a minimal standalone project.\n\n### Expected Result\n\nThe server boots, as it did on 10.x.\n\n### Actual Result\n\nThe server process exits while importing the server build:\n\n```\nfile:///app/build/server/assets/app-\u003chash>.js:26\nimport require$$0$1, { GLOBAL_OBJ, getAsyncContextStrategy, getMainCarrier, debug, getActiveSpan, spanIsIgnored, getRootSpan, withActiveSpan, captureException, SPAN_STATUS_ERROR, isObjectLike, getClient, waitForTracingChannelBinding, addNonEnumerableProperty, defineIntegration, hasSpanStreamingEnabled, startInactiveSpan } from \"@sentry/core\";\n ^^^^^^^^^^^^\nSyntaxError: The requested module '@sentry/core' does not provide an export named 'default'\n at ModuleJob._instantiate (node:internal/modules/esm/module_job:226:21)\n```\n\n`sentryOrchestrionPlugin` (`@sentry/server-utils/orchestrion/vite`) sets `ssr.noExternal` to the instrumented modules plus `@sentry/server-utils`. That bundles CommonJS code calling `require(\"@sentry/core\")`, and Rollup's CommonJS interop rewrites the call as a default import. `@sentry/core` stays external and ESM-only, so the default import fails at runtime. A comment in that plugin already names this failure mode for `@sentry/server-utils`; this is the same failure for `@sentry/core`.\n\nBuilds without an auth token never add the plugin, so they import fine. In our setup that meant every local and CI build passed, and only the production image crashed.\n\n### Additional Context\n\n- This looks like the same class as #24775 (`@sentry/nuxt` 11), which was fixed for Nuxt in #24799 (11.2.0). That fix doesn't seem to cover `@sentry/react-router/vite`; 11.7.0 still crashes.\n- Workaround: `buildTimeInstrumentation: false` in the `sentryReactRouter` options. With it, the bundle has no default imports of `@sentry/*` and the server boots. Instrumentation then runs through the runtime hook.\n\n### Priority\n\n\u003csub>React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.\u003c/sub>\n","author":{"url":"https://github.com/mlavesther","@type":"Person","name":"mlavesther"},"datePublished":"2026-10-13T18:31:51Z","url":"https://github.com/getsentry/sentry-javascript/issues/25339"}
| 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:b92fc855-1455-9ff1-d4ea-1370abf34ba2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C76C:27A9B8:1BEF250:24CB8B4:6B0412AE |
| html-safe-nonce | 1c50bcea2703c61e535d84c6b2a14c502e5354f6b1a1a8d2e841767350bc8c01 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzZDOjI3QTlCODoxQkVGMjUwOjI0Q0I4QjQ6NkIwNDEyQUUiLCJ2aXNpdG9yX2lkIjoiNzIzOTY1NzQwOTIwMjA5ODg2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1ba4f4e94b65848f69adeb151b88bbf03299a9aea6b569bc29ada3921c2cdbad |
| hovercard-subject-tag | issue:5835638032 |
| 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/25339/issue_layout |
| twitter:image | https://opengraph.githubassets.com/af6a203e70c8b94e97dd601d8db060fbb23a091c608120d1fa4d7e6d78bf3720/getsentry/sentry-javascript/issues/25339 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/af6a203e70c8b94e97dd601d8db060fbb23a091c608120d1fa4d7e6d78bf3720/getsentry/sentry-javascript/issues/25339 |
| og:image:alt | This issue was written with Claude Opus 5.5 (Anthropic) and reviewed by a human before it was filed. Is there an existing issue for this? I have checked for existing issues https://github.com/getse... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mlavesther |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| 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