Skip to content

fix(cloudflare): Use the release that a Sentry bundler plugin injected - #26914

Merged
JPeer264 merged 1 commit into
developfrom
jp/cloudflare-injected-release
Nov 26, 2026
Merged

JPeer264 merged 1 commit into
developfrom
jp/cloudflare-injected-release

Conversation

@JPeer264

@JPeer264 JPeer264 commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

This makes @sentry/cloudflare use the release that a Sentry bundler plugin injected into the build (globalThis.SENTRY_RELEASE), for example the plugin of sentryTanstackStart or sentryCloudflareVitePlugin.

Why

The Node and Vercel Edge SDKs read the injected release, but the Cloudflare SDK did not. Server events of a Worker had no release unless the release option or the SENTRY_RELEASE env var was set.

Release priority decisions

The order is now: release option, SENTRY_RELEASE env var, injected release, CF_VERSION_METADATA.id. The injected release is before the version metadata, because it is the release that the user configured for the build. The alternative is to put it last.

@JPeer264
JPeer264 added this pull request to stack #26917 November 26, 2026 07:43
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: ede0dee (PR test merge using develop at e07c24f)

Against: a159856 (develop) · base run #68059

⚠️ Baseline mismatch: 2 develop commit(s) in the PR build are missing from the baseline. Their size changes also affect this comparison. Compare commits. Re-run once develop's baseline build for e07c24f finishes.

Path Size % Change Change
@sentry/browser 30.54 kB - -
@sentry/browser - with treeshaking flags 28.73 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.6 kB - -
@sentry/browser (incl. Tracing) 53.66 kB - -
@sentry/browser (incl. Tracing Core) 40.58 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 53.66 kB - -
@sentry/browser (incl. Tracing, Profiling) 56.56 kB - -
@sentry/browser (incl. Tracing, Replay) 93.59 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 82.38 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 98.45 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 111.39 kB - -
@sentry/browser (incl. Feedback) 48.4 kB - -
@sentry/browser (incl. sendFeedback) 31.11 kB - -
@sentry/browser (incl. FeedbackAsync) 36.16 kB - -
@sentry/browser (incl. Metrics) 31.86 kB - -
@sentry/browser (incl. Logs) 32.13 kB - -
@sentry/browser (incl. Metrics & Logs) 32.8 kB - -
@sentry/react 32.56 kB - -
@sentry/react (incl. Tracing) 56.37 kB - -
@sentry/vue 38.74 kB - -
@sentry/vue (incl. Tracing) 56.67 kB - -
@sentry/svelte 30.57 kB - -
@sentry/effect (client) 42.22 kB - -
@sentry/effect (client, incl. Tracing) 54.96 kB - -
@sentry/effect (client, incl. Tracing, Logs, Metrics) 66.31 kB - -
@sentry/remix (Remix 3 client bundle) 59.39 kB - -
CDN Bundle 32.38 kB - -
CDN Bundle (incl. Tracing) 54.04 kB - -
CDN Bundle (incl. Logs, Metrics) 35.13 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 56.5 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 76.08 kB - -
CDN Bundle (incl. Tracing, Replay) 91.84 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 94.37 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.31 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.78 kB - -
CDN Bundle - uncompressed 94.56 kB - -
CDN Bundle (incl. Tracing) - uncompressed 159.84 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 102.9 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 167.47 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 233.29 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 280.28 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 287.9 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 292.21 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 299.83 kB - -
@sentry/nextjs (client) 60.08 kB - -
@sentry/sveltekit (client) 55.02 kB - -
@sentry/core/server 45.83 kB - -
@sentry/core/browser 14.46 kB - -
@sentry/node 157.38 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.45 kB - -
@sentry/node - without tracing 89.79 kB - -
@sentry/node - without channel injection 146.36 kB +0.01% +1 B 🔺
@sentry/aws-serverless 100.42 kB +0.01% +1 B 🔺
@sentry/cloudflare (withSentry) - minified 211.94 kB +0.02% +24 B 🔺
@sentry/cloudflare (withSentry) 491.72 kB +0.01% +35 B 🔺
@sentry/cloudflare (withSentry, instrumented CommonJS package) - minified 214.88 kB +0.02% +24 B 🔺
@sentry/nextjs/cloudflare (withSentry) - minified 237.18 kB +0.02% +24 B 🔺

View base workflow run

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

All optional checks were successful. 52 successful. See the run.

Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E astro-6 (bun) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E express-5 (cloudflare) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E astro-6 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E hono-5 (deno) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2-tunnel Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E express-5 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E hono-5 (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E astro-7 (static trace lifecycle) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E hono-5 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (no upload) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (bun) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-without-tracing-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-14-supabase Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (development) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (deno) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E express-5 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-4-sourcemaps (Vite server) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (kv-cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps enabled by Sentry) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 (manual upload) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (cloudflare) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E vinext-cf-workers (workers cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E hono-5 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solid-2-ssr (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel (cloudflare) Test (optional) Successful in 59s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 (no upload) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 (delete all) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-6 (cloudflare) Test (optional) Successful in 2m Details

A Sentry bundler plugin, for example the one of `sentryTanstackStart` or
`sentryCloudflareVitePlugin`, writes the release of the build to
`globalThis.SENTRY_RELEASE`. The Node and Vercel Edge SDKs read it, but the
Cloudflare SDK did not, so server events of a Worker had no release unless the
`release` option or the `SENTRY_RELEASE` env var was set.

The injected release now comes after the `SENTRY_RELEASE` env var and before
`CF_VERSION_METADATA.id`, as it is the release the user configured for the
build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JPeer264
JPeer264 force-pushed the jp/tanstackstart-serverfn-middleware-id branch from 7ed1b89 to 97656bb Compare November 26, 2026 08:13
@JPeer264
JPeer264 force-pushed the jp/cloudflare-injected-release branch from dc5c5dc to 6ca971e Compare November 26, 2026 08:13
@JPeer264
JPeer264 removed this pull request from stack #26917 November 26, 2026 08:14
@JPeer264
JPeer264 changed the base branch from jp/tanstackstart-serverfn-middleware-id to develop November 26, 2026 09:54
@JPeer264 JPeer264 self-assigned this Nov 26, 2026
@JPeer264
JPeer264 marked this pull request as ready for review November 26, 2026 10:01
@JPeer264
JPeer264 requested a review from andreiborza November 26, 2026 10:01
@JPeer264
JPeer264 requested review from nicohrubec and removed request for RulaKhaled and isaacs November 26, 2026 10:05

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

export ANDREI_APPROVAL=1

@JPeer264
JPeer264 merged commit 3f38bdc into develop Nov 26, 2026
320 of 354 checks passed
@JPeer264
JPeer264 deleted the jp/cloudflare-injected-release branch November 26, 2026 10:14
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.

3 participants