René's URL Explorer Experiment


Title: [nextjs] Turbopack: source map upload injects `_sentryDebugIds` into server chunks without shifting sectioned source maps (js_invalid_sourcemap_location) · Issue #26330 · getsentry/sentry-javascript · GitHub

Open Graph Title: [nextjs] Turbopack: source map upload injects `_sentryDebugIds` into server chunks without shifting sectioned source maps (js_invalid_sourcemap_location) · Issue #26330 · getsentry/sentry-javascript

X Title: [nextjs] Turbopack: source map upload injects `_sentryDebugIds` into server chunks without shifting sectioned source maps (js_invalid_sourcemap_location) · Issue #26330 · getsentry/sentry-javascript

Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...

Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...

X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...

Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/26330

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[nextjs] Turbopack: source map upload injects `_sentryDebugIds` into server chunks without shifting sectioned source maps (js_invalid_sourcemap_location)","articleBody":"### 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/nextjs\n\n### SDK Version\n\n11.12.0\n\n### Framework Version\n\nNext.js 16.4.5 (Turbopack)\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\nMinimal app, official manual setup, Next.js 16.4.5 (Turbopack is the default bundler).\n\n`package.json` dependencies: `next@16.4.5`, `react@19.3.0`, `react-dom@19.3.0`, `@sentry/nextjs@11.12.0` (resolves `@sentry/bundler-plugins@11.12.0`, `sentry@0.49.0`).\n\n`next.config.ts`\n```ts\nimport { withSentryConfig } from \"@sentry/nextjs/config\";\nimport type { NextConfig } from \"next\";\n\nconst nextConfig: NextConfig = {};\n\nexport default withSentryConfig(nextConfig, {\n  org: \"example-org\",\n  project: \"example-project\",\n  authToken: process.env.SENTRY_AUTH_TOKEN,\n  silent: !process.env.CI,\n});\n```\n\n`app/api/boom/route.ts`\n```ts\nexport async function GET() {\n  throw new Error(\"boom\");\n}\n```\n\n`instrumentation.ts`\n```ts\nimport * as Sentry from \"@sentry/nextjs\";\nexport async function register() {\n  if (process.env.NEXT_RUNTIME === \"nodejs\") await import(\"./sentry.server.config\");\n}\nexport const onRequestError = Sentry.captureRequestError;\n```\n\n`sentry.server.config.ts`\n```ts\nimport * as Sentry from \"@sentry/nextjs\";\nSentry.init({ dsn: \"https://public@example.com/1\" });\n```\n\n### Steps to Reproduce\n\n1. Create the app above and run `next build` **without** `SENTRY_AUTH_TOKEN`. Open the server chunk that contains the route (`.next/server/chunks/[root-of-the-server]__*.js`) and its `.map`.\n2. Run `SENTRY_AUTH_TOKEN=\u003cany value> CI=1 next build` (a fake token is enough to reproduce the file change; the upload itself then fails with 401).\n3. Open the same chunk and `.map` again and compare.\n\nWith a real token (Next.js 16.4.5 + Turbopack on Vercel), a server error thrown in a route handler arrives with a minified frame and the processing error `js_invalid_sourcemap_location` (\"Invalid location in sourcemap\").\n\n### Expected Result\n\nThe server chunk keeps lining up with its source map, and server stack frames are symbolicated to `app/api/boom/route.ts`.\n\nEither the upload leaves the chunk alone (Turbopack already wrote a native debug ID: the `//# debugId=` comment and a `_debugIds` snippet on line 1), or, if a `_sentryDebugIds` snippet is inserted, the source map is shifted by the same number of lines.\n\n### Actual Result\n\n| Build | `_sentryDebugIds` snippet in chunk | Line of `throw new Error(\"boom\")` | Source map `sections[0].offset` |\n|---|---|---|---|\n| no token | no | 2 | `{\"line\":1,\"column\":0}` |\n| token set | yes (new line 1) | 3 | `{\"line\":1,\"column\":0}` (unchanged) |\n\nTurbopack emits **index (sectioned) source maps** for server chunks: top-level `sections`, no top-level `mappings`. The injected snippet moves the code down one line, but the map is not shifted, so every server frame points one line off and Sentry reports `js_invalid_sourcemap_location`.\n\nThe unshifted map itself is fine: Node's `module.SourceMap` resolves the original position to the correct file and line.\n\n### Additional Context\n\nWhat I traced in the installed packages:\n\n- `@sentry/nextjs` `handleRunAfterProductionCompile` correctly skips `injectDebugIds()` when `usesNativeDebugIds` is true, then calls `uploadSourcemaps([distDir], { prepareArtifacts: false })`.\n- `@sentry/bundler-plugins` (`core/cli.js`) passes that directory to `sdk.sourcemap.upload(...)` of the `sentry` CLI (0.49.0).\n- In the `sentry` CLI upload path, a file is treated as already injected only if it has a `//# debugId=` comment **and** a `_sentryDebugIds` snippet with the same ID. Turbopack's native snippet uses `_debugIds`, so the CLI injects its own snippet on top. The map is then adjusted only when `typeof map.mappings === \"string\"`, which skips index maps with `sections`.\n- The CLI has a `skipSnippet` option, but `@sentry/nextjs` does not pass it, so there is no user-side setting to avoid this.\n\nSide note: without `next build --turbo` (or `TURBOPACK=1`), `detectActiveBundler()` treats the default Next.js 16 Turbopack build as webpack, `usesNativeDebugIds` is undefined, and `injectDebugIds()` runs: same off-by-one result. Passing `next build --turbo` avoids that step but not the injection during upload.\n\nPossibly related, different symptom (mangled names, frames do resolve): #18248.\n\n### Priority\n\n_No response_","author":{"url":"https://github.com/alpdeka","@type":"Person","name":"alpdeka"},"datePublished":"2026-11-12T22:35:28Z","url":"https://github.com/getsentry/sentry-javascript/issues/26330"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4b037c98-98af-173f-652d-4160080af5dc
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE546:14435D:200DB:2AC95:6B044872
html-safe-nonce50d93e9f6668869955b9ba00439148d204321150739d50c8b73760da97ead98a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTQ2OjE0NDM1RDoyMDBEQjoyQUM5NTo2QjA0NDg3MiIsInZpc2l0b3JfaWQiOiIyMDkzMTMwOTkzMjgzMzg1NDU4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac175894b70541518ccf32e6a16d5b3a669f6b3be084e8f9743f2b714511e63237
hovercard-subject-tagissue:6360393328
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/26330/issue_layout
twitter:imagehttps://opengraph.githubassets.com/87ff6147a2cbf5eaf1ae27b8959d56176aee8880bf4bdeea5da74fdff79faea2/getsentry/sentry-javascript/issues/26330
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/87ff6147a2cbf5eaf1ae27b8959d56176aee8880bf4bdeea5da74fdff79faea2/getsentry/sentry-javascript/issues/26330
og:image:altIs there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamealpdeka
hostnamegithub.com
expected-hostnamegithub.com
Noned4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/26330#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F26330
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F26330
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/26330
Reloadhttps://github.com/getsentry/sentry-javascript/issues/26330
Reloadhttps://github.com/getsentry/sentry-javascript/issues/26330
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues340 (340)https://github.com/getsentry/sentry-javascript/issues
Pull requests55 (55)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/26330
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/26330
[nextjs] Turbopack: source map upload injects _sentryDebugIds into server chunks without shifting sectioned source maps (js_invalid_sourcemap_location)https://github.com/getsentry/sentry-javascript/issues/26330#top
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Next.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Next.js%22
https://github.com/alpdeka
alpdekahttps://github.com/alpdeka
on Nov 12, 2026https://github.com/getsentry/sentry-javascript/issues/26330#issue-6360393328
https://github.com/getsentry/sentry-javascript/issueshttps://github.com/getsentry/sentry-javascript/issues
https://docs.sentry.io/https://docs.sentry.io/
https://github.com/getsentry/sentry-javascript/releaseshttps://github.com/getsentry/sentry-javascript/releases
#18248https://github.com/getsentry/sentry-javascript/issues/18248
alpdekahttps://github.com/alpdeka
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Nov 12, 2026https://github.com/getsentry/sentry-javascript/issues/26330#event-35969423989
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Nov 12, 2026https://github.com/getsentry/sentry-javascript/issues/26330#event-35969427015
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Nov 12, 2026https://github.com/getsentry/sentry-javascript/issues/26330#issuecomment-6837815262
Linear Codehttps://linear.app
JS-4101https://linear.app/getsentry/issue/JS-4101
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Nov 12, 2026https://github.com/getsentry/sentry-javascript/issues/26330#event-35969430126
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Nov 12, 2026https://github.com/getsentry/sentry-javascript/issues/26330
github-actionshttps://github.com/apps/github-actions
Next.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Next.js%22
on Nov 12, 2026https://github.com/getsentry/sentry-javascript/issues/26330#event-35969436674
https://github.com/alpdeka
alpdekahttps://github.com/alpdeka
on Nov 12, 2026https://github.com/getsentry/sentry-javascript/issues/26330#issuecomment-6838453989
https://github.com/msonnb
msonnbhttps://github.com/msonnb
on Nov 13, 2026https://github.com/getsentry/sentry-javascript/issues/26330#issuecomment-6849030467
@alpdekahttps://github.com/alpdeka
getsentry/toolkit#2190https://github.com/getsentry/toolkit/pull/2190
msonnbhttps://github.com/msonnb
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 13, 2026https://github.com/getsentry/sentry-javascript/issues/26330#event-36012610057
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Nov 13, 2026https://github.com/getsentry/sentry-javascript/issues/26330#event-36012612857
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/26330
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/26330
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Next.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Next.js%22
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.