Repository navigation
fix(nextjs): Inject build values into instrumentation for an external server SDK - #26292
Merged
Merged
Conversation
JPeer264
marked this pull request as ready for review
November 11, 2026 14:14
JPeer264
requested review from
chargome and
isaacs
and removed request for
msonnb and
stephanie-anderson
November 11, 2026 14:15
JPeer264
force-pushed
the
jp/nextjs-external-sdk-build-values
branch
from
November 11, 2026 15:09
f9736f6 to
b891775
Compare
Contributor
size-limit report 📦Compared: d5837c3 (PR test merge using develop at 621a801) Against: 621a801 (develop) · base run #65856 ✅ Baseline matches: this diff contains only this PR's changes.
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 1 not successful, 10 successful. See the run.
Successful checks
|
s1gr1d
reviewed
Nov 11, 2026
| vercelCronsConfig, | ||
| releaseName, | ||
| // Same value as `_sentryRewriteFramesDistDir` in `nextConfig.env` | ||
| distDirName: userNextConfig.distDir?.replace(/\\/g, '\\\\') || '.next', |
Member
There was a problem hiding this comment.
as discussed offline, this might not work on windows.
Member
Author
There was a problem hiding this comment.
Just checked, this is also in there since 2 years for webpack, and worked so far. So I'd rather want to keep it
isaacs
force-pushed
the
jp/nextjs-external-sdk-build-values
branch
from
November 12, 2026 10:25
b891775 to
551eae7
Compare
isaacs
force-pushed
the
jp/nextjs-external-sdk-build-values
branch
from
November 12, 2026 11:19
551eae7 to
b21bc14
Compare
s1gr1d
approved these changes
Nov 12, 2026
… server SDK Next.js inlines the values of `nextConfig.env` and `process.turbopack` only into code it compiles. When `@sentry/nextjs` is in `serverExternalPackages`, Turbopack builds therefore lost the build release, the dist dir for the stack frame rewrite, the base path and the `turbopack` tag. Turbopack now also injects these values as globals into `instrumentation.*`, as webpack already does for most of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JPeer264
force-pushed
the
jp/nextjs-external-sdk-build-values
branch
from
November 12, 2026 13:28
b21bc14 to
4818c22
Compare
51 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
part of #24830
part of JS-3835
On Turbopack builds, this injects the build release, the dist dir, the base path and a Turbopack flag as globals into
instrumentation.*. Webpack builds already inject most of them.Why
Next.js inlines
nextConfig.envandprocess.turbopackonly into code it compiles. When@sentry/nextjsis inserverExternalPackages, the server SDK had no build release, did not rewrite stack frames of the dist dir and did not set theturbopacktag.