feat(nextjs)!: Drop vercel- prefix from default environment and deploys - #24197
Merged
Merged
Conversation
… default environment and deploys On Vercel, @sentry/nextjs and @sentry/vercel-edge now default environment to the plain Vercel target environment instead of vercel-production / vercel-preview, and the deploys the bundler plugins create automatically on Vercel use the same value. The prefix only matched events for Next.js; every other SDK defaults environment to production, so the auto-created deploy never showed up next to their events. Both sides now read VERCEL_TARGET_ENV with VERCEL_ENV as fallback through one getVercelEnv helper in @sentry/core, which also fixes mismatching names for Vercel custom environments. Fixes getsentry/sentry-javascript-bundler-plugins#849 Refs BUNDLER-98
Member
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d2ef14f. Configure here.
The NEXT_PUBLIC_ variables are Next.js specific and must be referenced statically for Next.js to inline them, so the client lookup lives in @sentry/nextjs. The core helper only reads the server-side variables.
Contributor
size-limit report 📦
|
vercel- prefix from default environment and deploysvercel- prefix from default environment and deploys
chargome
marked this pull request as ready for review
September 8, 2026 11:17
chargome
requested review from
JPeer264,
Lms24,
isaacs,
nicohrubec and
s1gr1d
and removed request for
a team
September 8, 2026 11:17
andreiborza
approved these changes
Sep 8, 2026
s1gr1d
approved these changes
Sep 8, 2026
This was referenced Sep 16, 2026
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.
On Vercel,
@sentry/nextjsand@sentry/vercel-edgenow defaultenvironmentto the plain Vercel target environment (production,preview, or a custom environment name) instead ofvercel-production/vercel-preview. The deploys the bundler plugins create automatically on Vercel use the same value.Note that this also affects other meta frameworks deployed on vercel.
The linked issue proposed removing the automatic deploy entirely. We kept it, because with matching names it works out of the box; users can still opt out with
release.deploy: false.I did a quick cross check in all sentry services and found no hard coded occurrences of these env values.
Fixes getsentry/sentry-javascript-bundler-plugins#849
Refs BUNDLER-98