Title: @sentry/nextjs modifies app.js output hash by injecting release value · Issue #16593 · getsentry/sentry-javascript · GitHub
Open Graph Title: @sentry/nextjs modifies app.js output hash by injecting release value · Issue #16593 · getsentry/sentry-javascript
X Title: @sentry/nextjs modifies app.js output hash by injecting release value · Issue #16593 · 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/16593
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@sentry/nextjs modifies app.js output hash by injecting release value","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\n9.29.0\n\n### Framework Version\n\nReact 18.3.1, Next 13.5.11\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\n_No response_\n\n### Steps to Reproduce\n\n1. Use @sentry/nextjs in a Next.js project.\n2. Do not set the SENTRY_RELEASE environment variable.\n3. Ensure app.tsx has no changes.\n4. Build the app with next build.\n5. Commit a change (anywhere else in the repo, not in app.tsx) so that the Git commit hash changes.\n6. Build again with next build.\n7. Compare the two build outputs, especially `.next/static/chunks/app-*.js.`\n\n➡️ You will see that the hash of app.js has changed even though app.tsx has not been modified.\n\nIf you look inside the built app.js, the following line will appear:\n\n```javascript\n...\n return (\n t.push(\n nextjsClientStackFrameNormalizationIntegration({\n assetPrefix: r,\n basePath: i,\n rewriteFramesAssetPrefixPath: n,\n experimentalThirdPartyOriginStackFrames: a,\n })\n ),\n t\n );\n })(e),\n release: '827cbe163190075f8eaa853f1147d24150bfdd5f',\n ...e,\n };\n...\n```\nThis release value corresponds to the current Git commit hash and is injected automatically into the output by @sentry/nextjs.\n\nThis behavior was introduced by [this PR](https://github.com/getsentry/sentry-javascript/pull/15958).\n\n### Expected Result\n\nThe build output should be stable and deterministic.\n\n- If files like app.tsx are unchanged, the generated app.js and its hash should remain the same across builds.\n- The release value should not be injected into application bundles (like app.js) in a way that changes their content.\n- This should apply even if SENTRY_RELEASE is defined \n\n### Actual Result\n\nThe release field is injected using the current Git commit hash (e.g. '827cbe1631...') even when `SENTRY_RELEASE` is not defined.\nThis causes app.js to change and generate a new build hash, even though the source code (like app.tsx) is untouched.\n\nAs a result:\n**Caching is broken**\n","author":{"url":"https://github.com/sekyungk","@type":"Person","name":"sekyungk"},"datePublished":"2025-06-16T16:12:09Z","url":"https://github.com/getsentry/sentry-javascript/issues/16593"}
| 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:9d3bfa23-2e09-dca5-13e5-d0b89e3ec98c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A6E8:35BF1E:4159F:57CAF:6B072E9A |
| html-safe-nonce | e4c30a8df1fcedbb4f5dbb8935e03a2ddef86c8f677d77384017dd609ba8e40e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNkU4OjM1QkYxRTo0MTU5Rjo1N0NBRjo2QjA3MkU5QSIsInZpc2l0b3JfaWQiOiI3MTE4NDEyOTY5MjIyMjg3MDAyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4713bfd77238c0e1098b47be7763eb6f49277568843059e01ee12c4d908cbb6f |
| hovercard-subject-tag | issue:3150554428 |
| 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/16593/issue_layout |
| twitter:image | https://opengraph.githubassets.com/72af4a168b962be4823365319a5253852814792d2ba67e2569b7fb0e7517ed49/getsentry/sentry-javascript/issues/16593 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/72af4a168b962be4823365319a5253852814792d2ba67e2569b7fb0e7517ed49/getsentry/sentry-javascript/issues/16593 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sekyungk |
| hostname | github.com |
| expected-hostname | github.com |
| None | d0534ce3ec0f37caea4f39713cbc8a6a509506c09c7ac30e8e3e2e15348bd9c1 |
| 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 | a73ca0a5164c4669446bdffe239b0d7542ad735e |
| 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