Title: @sentry/sveltekit 11: orchestrion build-time transform emits a module-relative source without sourcesContent, breaking server source map flattening · Issue #25329 · getsentry/sentry-javascript · GitHub
Open Graph Title: @sentry/sveltekit 11: orchestrion build-time transform emits a module-relative source without sourcesContent, breaking server source map flattening · Issue #25329 · getsentry/sentry-javascript
X Title: @sentry/sveltekit 11: orchestrion build-time transform emits a module-relative source without sourcesContent, breaking server source map flattening · Issue #25329 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues (closest one: #25322, Nuxt server maps without sourcesContent, which is a different mechanism) How do you use Sentry? Sentry SaaS (sentry.io) Which SDK are you using...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues (closest one: #25322, Nuxt server maps without sourcesContent, which is a different mechanism) How do you use Sentry? Sentry ...
X Description: Is there an existing issue for this? I have checked for existing issues (closest one: #25322, Nuxt server maps without sourcesContent, which is a different mechanism) How do you use Sentry? Sentry ...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/25329
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@sentry/sveltekit 11: orchestrion build-time transform emits a module-relative source without sourcesContent, breaking server source map flattening","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues (closest one: #25322, Nuxt server maps without `sourcesContent`, which is a different mechanism)\n\n### How do you use Sentry?\n\nSentry SaaS (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/sveltekit\n\n### SDK Version\n\n11.6.0 (the vendored `@apm-js-collab/code-transformer/lib/transformer.js` is byte-identical in 11.7.0)\n\n### Framework Version\n\n@sveltejs/kit 2.70.3, @sveltejs/adapter-node 5.5.7, Vite 8.3.1 (Rolldown), Node 24, pnpm 11 (isolated `node_modules/.pnpm`)\n\n### Steps to Reproduce\n\n1. SvelteKit app with `sentrySvelteKit()` in `vite.config.ts` (v11 auto-adds the orchestrion bundler plugin) and server code that imports a dependency orchestrion instruments, e.g. `ioredis` or the Vercel AI SDK (`ai`).\n2. `vite build` with `build.sourcemap: true`.\n3. Inspect the SSR output map of a chunk that bundles the instrumented module, e.g. `.svelte-kit/output/server/entries/endpoints/\u003croute>/_server.ts.js.map`.\n\n### Expected Result\n\nEvery entry in `sources` resolves to a real file (or has `sourcesContent`), so source map flattening (Sentry's own `sorcery` pass in `uploadSourceMaps`, or any chaining tool) can follow the chain back to the original sources.\n\n### Actual Result\n\nNext to the real entry for the instrumented file, the map contains an extra, module-relative source with no `sourcesContent`:\n\n```\n480 '../../../../../../../../node_modules/.pnpm/ioredis@5.11.1_\u003chash>/node_modules/ioredis/built/Redis.js' (has sourcesContent)\n481 '../../../../../../../../ioredis/built/Redis.js' (NO sourcesContent)\n```\n\nThe second path resolves to `\u003cproject root>/ioredis/built/Redis.js`, which does not exist. The same happens for `ai/dist/index.mjs`. Any flattening step then fails for the whole chunk:\n\n```\nENOENT: no such file or directory, open '\u003cproject root>/ioredis/built/Redis.js'\nENOENT: no such file or directory, open '\u003cproject root>/ai/dist/index.mjs'\n```\n\n`uploadSourceMaps()` in `@sentry/sveltekit/build/esm/vite/sourceMaps.js` catches this as a \"known\" ENOENT and moves on, so the uploaded map for that chunk is left unflattened and stack frames from it resolve to the intermediate SvelteKit/adapter output instead of `src/`. In our app this affects exactly the chunks that bundle an orchestrion-instrumented dependency (2 of ~1,300 server chunks); a build of the same app on @sentry/sveltekit 10.75.3 does not have these two failures.\n\nLikely cause, in the vendored `@apm-js-collab/code-transformer/lib/transformer.js` (`Transformer#transform`):\n\n```js\nconst file = `${moduleName}/${filePath}`; // e.g. \"ioredis/built/Redis.js\"\ngenerator = sourcemap\n ? SourceMapGenerator.fromSourceMap(consumer) // consumer.file = file\n : new SourceMapGenerator({ file });\nconst code2 = generate(ast, { sourceMap: generator });\n```\n\nWhen the module has no input source map (true for `ioredis/built/Redis.js`), the generated map names its source with the module-relative `file` and never calls `setSourceContent`, and the bundler keeps that name verbatim. Using the transformed module's absolute `id` as the source name, or embedding the original code as `sourcesContent`, would make the map self-contained. Returning `map: null` when the transform only inserts code without moving it might also be enough for Vite/Rolldown to keep the original mapping.\n\n### Additional Context\n\nFound while upgrading a production SvelteKit 2 app from @sentry/sveltekit 10 to 11. Happy to test a fix.\n","author":{"url":"https://github.com/andre-salata","@type":"Person","name":"andre-salata"},"datePublished":"2026-10-13T13:33:21Z","url":"https://github.com/getsentry/sentry-javascript/issues/25329"}
| 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:6e6ff7fd-fd42-3892-4ccf-10347c0abf2d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 97B4:15A4DC:1D9A993:27C9F8E:6B044779 |
| html-safe-nonce | 380a88f725cf02fe83415263ad1ab9c269293fcdb0654c7c8807b629b4c2a848 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5N0I0OjE1QTREQzoxRDlBOTkzOjI3QzlGOEU6NkIwNDQ3NzkiLCJ2aXNpdG9yX2lkIjoiODU0NDM2NjUzMjY3ODE0MTgxNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 181530f3cbc97469d6dcad75fd47a3b9eaccc5974c0ae7c63b275ed776396ef7 |
| hovercard-subject-tag | issue:5831274233 |
| 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/25329/issue_layout |
| twitter:image | https://opengraph.githubassets.com/258b98d3ce00d29c02a13558f2a5708d48561f2ab78c62b5486a8408f39b0076/getsentry/sentry-javascript/issues/25329 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/258b98d3ce00d29c02a13558f2a5708d48561f2ab78c62b5486a8408f39b0076/getsentry/sentry-javascript/issues/25329 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues (closest one: #25322, Nuxt server maps without sourcesContent, which is a different mechanism) How do you use Sentry? Sentry ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andre-salata |
| hostname | github.com |
| expected-hostname | github.com |
| None | d4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46 |
| 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 | 9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77 |
| ui-target | canary-2 |
| 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