Skip to content

fix(nextjs): Don't inject trace meta tags when Cache Components is enabled - #21141

Merged
chargome merged 5 commits into
developfrom
cg/cache-components-streaming
Jun 30, 2026
Merged

fix(nextjs): Don't inject trace meta tags when Cache Components is enabled#21141
chargome merged 5 commits into
developfrom
cg/cache-components-streaming

Conversation

@chargome

@chargomechargome commented May 22, 2026

Copy link
Copy Markdown
Member

Problem is that we do not have a consistent way of detecting stale meta tags so we rather disable them for cacheComponents.

This stops the SDK from enabling Next's experimental.clientTraceMetadata (sentry-trace/baggage) when cacheComponents is enabled. With no meta tags injected, the browser pageload starts a fresh, self-contained trace instead of stitching onto a stale one. Apps that don't use Cache Components are unaffected.

closes https://linear.app/getsentry/issue/JS-2782/cachecomponents-setup-breaks-meta-tag-injection

@chargomechargome self-assigned this May 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you apply the label PR: no-auto-close I will leave it alone ... forever!

chargomeand others added 3 commits June 30, 2026 11:32
…s-streaming
# Conflicts:
#	dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/tests/cacheComponents.spec.ts
Resolves the dependency-review failure caused by pinning a vulnerable next 16.2.3.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser27.62 kB+0.53%+143 B 🔺
@sentry/browser - with treeshaking flags26.05 kB+0.56%+145 B 🔺
@sentry/browser (incl. Tracing)46.07 kB+0.24%+108 B 🔺
@sentry/browser (incl. Tracing + Span Streaming)47.82 kB+0.2%+95 B 🔺
@sentry/browser (incl. Tracing, Profiling)50.84 kB+0.17%+82 B 🔺
@sentry/browser (incl. Tracing, Replay)85.31 kB+0.11%+89 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags74.91 kB+0.14%+101 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)89.99 kB+0.09%+80 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)102.67 kB+0.1%+95 B 🔺
@sentry/browser (incl. Feedback)44.8 kB+0.31%+137 B 🔺
@sentry/browser (incl. sendFeedback)32.42 kB+0.49%+158 B 🔺
@sentry/browser (incl. FeedbackAsync)37.55 kB+0.4%+147 B 🔺
@sentry/browser (incl. Metrics)28.68 kB+0.5%+141 B 🔺
@sentry/browser (incl. Logs)28.93 kB+0.52%+149 B 🔺
@sentry/browser (incl. Metrics & Logs)29.61 kB+0.5%+145 B 🔺
@sentry/react29.41 kB+0.48%+139 B 🔺
@sentry/react (incl. Tracing)48.38 kB+0.21%+100 B 🔺
@sentry/vue32.85 kB+0.69%+222 B 🔺
@sentry/vue (incl. Tracing)47.93 kB+0.21%+98 B 🔺
@sentry/svelte27.64 kB+0.53%+145 B 🔺
CDN Bundle30.02 kB+0.47%+139 B 🔺
CDN Bundle (incl. Tracing)48.02 kB+0.27%+127 B 🔺
CDN Bundle (incl. Logs, Metrics)31.58 kB+0.47%+147 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics)49.35 kB+0.23%+112 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics)70.79 kB+0.01%+5 B 🔺
CDN Bundle (incl. Tracing, Replay)85.51 kB+0.14%+112 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)86.79 kB+0.13%+112 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)91.32 kB+0.15%+130 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)92.56 kB+0.13%+111 B 🔺
CDN Bundle - uncompressed89.42 kB+0.54%+475 B 🔺
CDN Bundle (incl. Tracing) - uncompressed145.35 kB+0.23%+322 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed94.12 kB+0.51%+476 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed149.32 kB+0.22%+323 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed218.66 kB+0.02%+39 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed264.36 kB+0.13%+317 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed268.32 kB+0.12%+318 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed278.06 kB+0.12%+317 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed282.01 kB+0.12%+318 B 🔺
@sentry/nextjs (client)50.76 kB+0.19%+92 B 🔺
@sentry/sveltekit (client)46.46 kB+0.2%+92 B 🔺
@sentry/core/server77.75 kB+0.38%+291 B 🔺
@sentry/core/browser64.06 kB+0.4%+253 B 🔺
@sentry/node-core61.47 kB-0.07%-37 B 🔽
@sentry/node122.82 kB-1.42%-1.77 kB 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection)69.95 kB--
@sentry/node/light50.45 kB+0.1%+47 B 🔺
@sentry/node - without tracing73.2 kB-0.56%-408 B 🔽
@sentry/aws-serverless84.09 kB-0.38%-313 B 🔽
@sentry/cloudflare (withSentry) - minified180.62 kB+0.18%+316 B 🔺
@sentry/cloudflare (withSentry)446.93 kB+0.16%+698 B 🔺

View base workflow run

@chargomechargome changed the title test(e2e): Add streaming variant of nextjs app with cache componentsfix(nextjs): Don't inject trace meta tags when Cache Components is enabledJun 30, 2026
@linear-code

Copy link
Copy Markdown

JS-2782

@chargome
chargome marked this pull request as ready for review June 30, 2026 13:54
@chargome
chargome requested a review from a team as a code ownerJune 30, 2026 13:54
@chargome
chargome requested review from logaretm, mydea, nicohrubec and s1gr1d and removed request for a team and mydeaJune 30, 2026 13:54
@chargome
chargome merged commit bf21b16 into developJun 30, 2026
531 of 535 checks passed
@chargome
chargome deleted the cg/cache-components-streaming branch June 30, 2026 14:29
Sign up for freeto 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.

2 participants

@chargome@logaretm