Skip to content

feat(nextjs)!: Drop vercel- prefix from default environment and deploys - #24197

Merged
chargome merged 4 commits into
developfrom
remove-vercel-deploy-dete
Sep 8, 2026
Merged

chargome merged 4 commits into
developfrom
remove-vercel-deploy-dete

Conversation

@chargome

@chargome chargome commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

On Vercel, @sentry/nextjs and @sentry/vercel-edge now default environment to the plain Vercel target environment (production, preview, or a custom environment name) instead of vercel-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

… 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
@chargome chargome self-assigned this Sep 8, 2026
@chargome

chargome commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

bugbot run

@linear-code

linear-code Bot commented Sep 8, 2026

Copy link
Copy Markdown

BUNDLER-98

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.8 kB - -
@sentry/browser - with treeshaking flags 27.11 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27 kB - -
@sentry/browser (incl. Tracing) 49.22 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 49.22 kB - -
@sentry/browser (incl. Tracing, Profiling) 52.12 kB - -
@sentry/browser (incl. Tracing, Replay) 88.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.95 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 93.44 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 106.37 kB - -
@sentry/browser (incl. Feedback) 46.3 kB - -
@sentry/browser (incl. sendFeedback) 33.86 kB - -
@sentry/browser (incl. FeedbackAsync) 38.97 kB - -
@sentry/browser (incl. Metrics) 29.82 kB - -
@sentry/browser (incl. Logs) 30.09 kB - -
@sentry/browser (incl. Metrics & Logs) 30.75 kB - -
@sentry/react 30.55 kB - -
@sentry/react (incl. Tracing) 51.56 kB - -
@sentry/vue 36.05 kB - -
@sentry/vue (incl. Tracing) 51.48 kB - -
@sentry/svelte 28.83 kB - -
CDN Bundle 30.55 kB - -
CDN Bundle (incl. Tracing) 49.74 kB - -
CDN Bundle (incl. Logs, Metrics) 32.82 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.7 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.48 kB - -
CDN Bundle (incl. Tracing, Replay) 87.29 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 89.18 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 93.22 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 95.21 kB - -
CDN Bundle - uncompressed 90.46 kB - -
CDN Bundle (incl. Tracing) - uncompressed 148.17 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.03 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 154.14 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.29 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.76 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 273.71 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.46 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 287.4 kB - -
@sentry/nextjs (client) 54 kB -0.06% -32 B 🔽
@sentry/sveltekit (client) 49.65 kB - -
@sentry/core/server 36.99 kB - -
@sentry/core/browser 13.55 kB - -
@sentry/node 127.73 kB +0.02% +21 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.61 kB - -
@sentry/node - without tracing 88.73 kB +0.03% +21 B 🔺
@sentry/node - without channel injection 106.97 kB +0.02% +21 B 🔺
@sentry/aws-serverless 97.12 kB +0.03% +24 B 🔺
@sentry/cloudflare (withSentry) - minified 201.95 kB - -
@sentry/cloudflare (withSentry) 502.67 kB - -

View base workflow run

@chargome chargome changed the title feat(nextjs,vercel-edge,bundler-plugins)!: Drop vercel- prefix from default environment and deploys feat(nextjs)!: Drop vercel- prefix from default environment and deploys Sep 8, 2026
@chargome
chargome marked this pull request as ready for review September 8, 2026 11:17
@chargome
chargome requested review from a team as code owners September 8, 2026 11:17
@chargome
chargome requested review from JPeer264, Lms24, isaacs, nicohrubec and s1gr1d and removed request for a team September 8, 2026 11:17
@chargome
chargome merged commit ac123ed into develop Sep 8, 2026
309 of 310 checks passed
@chargome
chargome deleted the remove-vercel-deploy-dete branch September 8, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove automatic Vercel deploy environment detection in next major

3 participants