Skip to content

fix(tanstackstart-react): Report the TanStack Start SDK name with the Cloudflare Vite plugin - #26925

Merged
andreiborza merged 1 commit into
developfrom
jp/tanstackstart-cloudflare-sdk-name
Nov 27, 2026
Merged

andreiborza merged 1 commit into
developfrom
jp/tanstackstart-cloudflare-sdk-name

Conversation

@JPeer264

Copy link
Copy Markdown
Member

part of #24839

Description

This makes @sentry/tanstackstart-react report sentry.javascript.tanstackstart-react when the app uses sentryCloudflareVitePlugin() from @sentry/cloudflare/vite. wrapFetchWithSentry sets the name on the client and keeps @sentry/cloudflare in the SDK packages.

Why

With that plugin, @sentry/cloudflare inits the client, so events had the SDK name sentry.javascript.cloudflare. On Node, events already have the TanStack Start name.

SDK name decisions

wrapFetchWithSentry sets the name at request time, the same as the @sentry/astro middleware does (#26848). The alternative is a build-time change that gives the metadata to the withSentry wrap of @sentry/cloudflare/vite.

… Cloudflare Vite plugin

With `sentryCloudflareVitePlugin()` of `@sentry/cloudflare/vite`,
`@sentry/cloudflare` inits the client, so events had the SDK name
`sentry.javascript.cloudflare`. `wrapFetchWithSentry` now sets
`sentry.javascript.tanstackstart-react` on the client and keeps
`@sentry/cloudflare` in the SDK packages.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 05f6c49 (PR test merge using develop at cbff039)

Against: cbff039 (develop) · base run #68111

✅ Baseline matches: this diff contains only this PR's changes.

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 +0.01% +1 B 🔺
@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% +2 B 🔺
@sentry/aws-serverless 100.42 kB +0.01% +2 B 🔺
@sentry/cloudflare (withSentry) - minified 211.94 kB - -
@sentry/cloudflare (withSentry) 491.72 kB - -
@sentry/cloudflare (withSentry, instrumented CommonJS package) - minified 214.88 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 237.18 kB - -

View base workflow run

@github-actions

Copy link
Copy Markdown
Contributor

Optional E2E tests

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

Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (no upload) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps 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 tanstackstart-react (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (delete all) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps (manual upload) Test (optional) Successful in 1m Details

@JPeer264
JPeer264 marked this pull request as ready for review November 26, 2026 13:53
@JPeer264 JPeer264 self-assigned this Nov 26, 2026
@JPeer264
JPeer264 requested a review from nicohrubec November 26, 2026 13:53
// With `sentryCloudflareVitePlugin()` of `@sentry/cloudflare/vite`, `@sentry/cloudflare` inits the client.
const sdk = getClient()?.getOptions()._metadata?.sdk;
if (sdk && sdk.name !== SDK_NAME) {
sdk.name = SDK_NAME;

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.

Since the SDK is renamed only after the client is created, the sentry_client param in the envelope endpoint URL will still say cloudflare, and only the event payload says tanstackstart-react. Same as Astro, so probably fine?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah it is fine. It’s a good point though to fix it even for the beginning as well. Might only work with Vite I guess. I’ll add a follow up task for that

@andreiborza
andreiborza merged commit d799281 into develop Nov 27, 2026
74 checks passed
@andreiborza
andreiborza deleted the jp/tanstackstart-cloudflare-sdk-name branch November 27, 2026 12:37
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.

5 participants