René's URL Explorer Experiment


Title: orchestrion deps are partially tree-shaken · Issue #23664 · getsentry/sentry-javascript · GitHub

Open Graph Title: orchestrion deps are partially tree-shaken · Issue #23664 · getsentry/sentry-javascript

X Title: orchestrion deps are partially tree-shaken · Issue #23664 · getsentry/sentry-javascript

Description: When a downstream bundler bundles @sentry/node (Next.js server build, serverless bundling, nitro/vite) and honours sideEffects: false, part of the orchestrion runtime transformer chain is deleted and part is kept. The kept parts seem to ...

Open Graph Description: When a downstream bundler bundles @sentry/node (Next.js server build, serverless bundling, nitro/vite) and honours sideEffects: false, part of the orchestrion runtime transformer chain is deleted a...

X Description: When a downstream bundler bundles @sentry/node (Next.js server build, serverless bundling, nitro/vite) and honours sideEffects: false, part of the orchestrion runtime transformer chain is deleted a...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"orchestrion deps are partially tree-shaken","articleBody":"When a downstream bundler bundles `@sentry/node` (Next.js server build, serverless bundling, nitro/vite) and honours `sideEffects: false`, part of the orchestrion runtime transformer chain is deleted and part is kept. The kept parts seem to have no connection to whether the SDK needs it or not as the remaining code wouldn't execute safely.\n\nIt seems to be decided by whether each vendored CommonJS dependency writes `exports.foo = ...` or `module.exports = ...`, and this behavior was indicated by some experiments I was doing in rolldown which prompted me to check rollup behavior there as well. So seems like the UMD footer in esquery changes the tree-shaking decision taken in either bundlers, with rolldown being worse than rollup.\n\nThe result on `develop` today is that the parser parts (meriyah, source-map, and astring) are deleted while the selector matcher (esquery) is kept, even though the transformer calls both in the same function, so that could would actually throw if executed but it doesn't get executed.\n\nIn `develop`'s bundled output, `_virtual/meriyah.js` looks like this\n\n```js\nvar meriyah = {};\n```\n\nthen you can see this in the output bundles:\n\n`code-transformer/lib/transformer.js` uses both in the same code path:\n\n```js\nconst { parse } = meriyah;                        // meriyah is {} -> parse is undefined\n// ...\nesquery.traverse(ast, esquery.parse(query), ...)  // esquery is present\n```\n\nI took a look at the chain and it is reachable from `init()`:\n\n```\n@sentry/node/index.js\n  -> sdk/index.js\n    -> @sentry/server-utils/orchestrion/register   (registerDiagnosticsChannelInjection)\n      -> @apm-js-collab/tracing-hooks\n        -> @apm-js-collab/code-transformer\n          -> meriyah, esquery, astring, source-map\n```\n\n### is this intended?\n\nI initially thought this might be intended as it could be needed for runtime import hooks but then the half shaken code wouldn't work from what I could tell.\n\nAFAIK orchestrion works in two modes, bundled or runtime, so current state feels weird for both:\n\n- deps the bundler inlined -> transformed at build time -> the runtime transformer is dead weight for those\n- deps left external -> only the runtime hook can reach them -> the transformer must be present in the app but it is half shaken out\n\nI created this repo to test this, it could be I'm missing something fundamental but as far as I can tell we have no tests covering bundled instrumentation emitting the telemetry expected.\n\nhttps://github.com/logaretm/orchestrion-treeshake-repro","author":{"url":"https://github.com/logaretm","@type":"Person","name":"logaretm"},"datePublished":"2026-08-26T18:39:38Z","url":"https://github.com/getsentry/sentry-javascript/issues/23664"}

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:9805ea44-c969-33a6-0a60-23c7c11f55fd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE1B0:2FF40E:83CC64:B909BF:6B0480ED
html-safe-noncea1c55acddb6c61dbb502e314c7676e2af06169c1947f90a184663950387f076c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMUIwOjJGRjQwRTo4M0NDNjQ6QjkwOUJGOjZCMDQ4MEVEIiwidmlzaXRvcl9pZCI6IjEyNjI2Mjk5MTMzMzMzNjcwMjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac50a1aef47d57dba36ec94b3d2d45ad324fe3fb62aca1c65ae82da4330366f1f5
hovercard-subject-tagissue:5260321802
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/23664/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6fdba915011dc13ef0cf073cebe7ba51a492774425deb98d42ea7b9f07bfbd62/getsentry/sentry-javascript/issues/23664
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6fdba915011dc13ef0cf073cebe7ba51a492774425deb98d42ea7b9f07bfbd62/getsentry/sentry-javascript/issues/23664
og:image:altWhen a downstream bundler bundles @sentry/node (Next.js server build, serverless bundling, nitro/vite) and honours sideEffects: false, part of the orchestrion runtime transformer chain is deleted a...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamelogaretm
hostnamegithub.com
expected-hostnamegithub.com
None0366ddfb372682a32e92a5d86155cb08fa83e5bbe79953a968789f2f7e24c511
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
releaseed3f2e01f6b7672780c586c8af0e72726374d7b6
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/23664#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F23664
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%2F23664
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/23664
Reloadhttps://github.com/getsentry/sentry-javascript/issues/23664
Reloadhttps://github.com/getsentry/sentry-javascript/issues/23664
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues339 (339)https://github.com/getsentry/sentry-javascript/issues
Pull requests53 (53)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/23664
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/23664
#23675https://github.com/getsentry/sentry-javascript/pull/23675
orchestrion deps are partially tree-shakenhttps://github.com/getsentry/sentry-javascript/issues/23664#top
#23675https://github.com/getsentry/sentry-javascript/pull/23675
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Node.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Node.js%22
javascriptPull requests that update javascript codehttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22javascript%22
https://github.com/logaretm
logaretmhttps://github.com/logaretm
on Aug 26, 2026https://github.com/getsentry/sentry-javascript/issues/23664#issue-5260321802
https://github.com/logaretm/orchestrion-treeshake-reprohttps://github.com/logaretm/orchestrion-treeshake-repro
https://github.com/apps/linear-code
linear-codehttps://github.com/apps/linear-code
on Aug 26, 2026https://github.com/getsentry/sentry-javascript/issues/23664#issuecomment-5429562205
Linear Codehttps://linear.app
JS-3449https://linear.app/getsentry/issue/JS-3449
linear-codehttps://github.com/apps/linear-code
javascriptPull requests that update javascript codehttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22javascript%22
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Node.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Node.js%22
on Aug 26, 2026https://github.com/getsentry/sentry-javascript/issues/23664#event-30061718053
mydeahttps://github.com/mydea
on Aug 27, 2026https://github.com/getsentry/sentry-javascript/issues/23664#event-30099461984
feat(server-utils): Warn when the orchestrion runtime hook was bundledhttps://github.com/getsentry/sentry-javascript/commit/84145c7b23244f8324d168f745df33e05c593a7a
84145c7https://github.com/getsentry/sentry-javascript/commit/84145c7b23244f8324d168f745df33e05c593a7a
feat(server-utils): Keep @sentry/node external in the vite orchestrio…https://github.com/getsentry/sentry-javascript/commit/aa07b3d1daeb5545ad29697061541d2576122af1
aa07b3dhttps://github.com/getsentry/sentry-javascript/commit/aa07b3d1daeb5545ad29697061541d2576122af1
docs(node): Document keeping @sentry/server-utils external when bundlinghttps://github.com/getsentry/sentry-javascript/commit/05b1e778ec7e91132a7be7798f56192c6ee27939
05b1e77https://github.com/getsentry/sentry-javascript/commit/05b1e778ec7e91132a7be7798f56192c6ee27939
feat(server-utils): Stay quiet when build-time instrumentation covers…https://github.com/getsentry/sentry-javascript/commit/15406097115e6e76fe7ef20586ecad9c73c83ef9
1540609https://github.com/getsentry/sentry-javascript/commit/15406097115e6e76fe7ef20586ecad9c73c83ef9
feat(server-utils): Warn when the orchestrion runtime hook was bundledhttps://github.com/getsentry/sentry-javascript/commit/17976865aabd01ab2902e093262951e19902c0e7
1797686https://github.com/getsentry/sentry-javascript/commit/17976865aabd01ab2902e093262951e19902c0e7
feat(server-utils): Keep @sentry/node external in the vite orchestrio…https://github.com/getsentry/sentry-javascript/commit/77b537594c809c780042bf031ec5c70e6522a9b9
77b5375https://github.com/getsentry/sentry-javascript/commit/77b537594c809c780042bf031ec5c70e6522a9b9
docs(node): Document keeping @sentry/server-utils external when bundlinghttps://github.com/getsentry/sentry-javascript/commit/34084c72b2051b2464b55cabb2f961220c50693d
34084c7https://github.com/getsentry/sentry-javascript/commit/34084c72b2051b2464b55cabb2f961220c50693d
feat(server-utils): Stay quiet when build-time instrumentation covers…https://github.com/getsentry/sentry-javascript/commit/a3e6fe25c4507ce93ae216d755802ff70133cd7c
a3e6fe2https://github.com/getsentry/sentry-javascript/commit/a3e6fe25c4507ce93ae216d755802ff70133cd7c
feat(server-utils): Warn when the orchestrion runtime hook was bundledhttps://github.com/getsentry/sentry-javascript/commit/120dcb8f854bf243d9455161ddb26de5dc6341e1
120dcb8https://github.com/getsentry/sentry-javascript/commit/120dcb8f854bf243d9455161ddb26de5dc6341e1
feat(server-utils): Keep @sentry/node external in the vite orchestrio…https://github.com/getsentry/sentry-javascript/commit/ca87750b9d6e3b03901d24b7cb4dc6b2fbb8aee2
ca87750https://github.com/getsentry/sentry-javascript/commit/ca87750b9d6e3b03901d24b7cb4dc6b2fbb8aee2
docs(node): Document keeping @sentry/server-utils external when bundlinghttps://github.com/getsentry/sentry-javascript/commit/1b7979122f97ec9b82c81b869ac961724f250b84
1b79791https://github.com/getsentry/sentry-javascript/commit/1b7979122f97ec9b82c81b869ac961724f250b84
feat(server-utils): Stay quiet when build-time instrumentation covers…https://github.com/getsentry/sentry-javascript/commit/fd162752d857e37ba02d0b2e7d797ddc17ebf1d6
fd16275https://github.com/getsentry/sentry-javascript/commit/fd162752d857e37ba02d0b2e7d797ddc17ebf1d6
mydeahttps://github.com/mydea
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#23675https://github.com/getsentry/sentry-javascript/pull/23675
on Aug 31, 2026https://github.com/getsentry/sentry-javascript/issues/23664#event-30283211332
mydeahttps://github.com/mydea
on Aug 31, 2026https://github.com/getsentry/sentry-javascript/issues/23664#event-30283213870
fix(node): Detect + warn when the orchestrion runtime hook is bundled (…https://github.com/getsentry/sentry-javascript/commit/cc0af5fcb6fe0ccd801ad0d1145f2b7930c58525
…https://github.com/getsentry/sentry-javascript/pull/23675
cc0af5fhttps://github.com/getsentry/sentry-javascript/commit/cc0af5fcb6fe0ccd801ad0d1145f2b7930c58525
feat(server-utils): Warn when the orchestrion runtime hook was bundledhttps://github.com/getsentry/sentry-javascript/commit/499b1ef4bbe7b716d3ec6c78d0be52ff618f34fa
499b1efhttps://github.com/getsentry/sentry-javascript/commit/499b1ef4bbe7b716d3ec6c78d0be52ff618f34fa
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Sep 23, 2026https://github.com/getsentry/sentry-javascript/issues/23664#issuecomment-5795109731
GitHub Actionshttps://help.github.com/en/actions
#23675https://github.com/getsentry/sentry-javascript/pull/23675
11.0.0 releasehttps://github.com/getsentry/sentry-javascript/releases/tag/11.0.0
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/23664
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/23664
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Node.jshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Node.js%22
javascriptPull requests that update javascript codehttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22javascript%22
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.