Skip to content

fix(solidstart): Deliver the release to the browser through the page - #26513

Open
sentry-junior[bot] wants to merge 1 commit into
feat/webpack-plugin-release-inject-htmlfrom
fix/solidstart-release-runtime
Open

sentry-junior[bot] wants to merge 1 commit into
feat/webpack-plugin-release-inject-htmlfrom
fix/solidstart-release-runtime

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

What

The server adds <meta name="sentry-release"> to each page, and the client init reads it when no release is passed. The client build no longer injects the release; server builds still do. This covers SSR, SPA (prerendered index.html) and static output on SolidStart 1 (Nitro v2 plugin) and 2 (Nitro v3 middleware). release.inject: false turns the meta tag off too, and an explicit Sentry.init({ release }) still wins.

Why

The release (the git SHA by default) was written into the client startup chunks, so every commit changed their content hashes, and the renames spread to every chunk importing them. Returning visitors lost their cached chunks on every deploy. A meta tag needs no CSP nonce.

Open decisions:

  • SolidStart 1 public output still has precompressed (.br/.gz) copies of server chunks with the release under .output/public/assets/ and _server/assets/. Browsers never request them, so caching isn't affected. Clearing them would mean turning off injection for the vinxi ssr and server-fns routers too.
  • Two plugin instances (client with inject: false, server as before), scoped by vinxi router target or Vite environment. Worth checking that release finalize or deploy doesn't run twice.
  • Body rewriting: encoded bodies are skipped. Streams are buffered up to 64 KiB while looking for <head>, and content-length is dropped.

Stacked on #26512.

Ref: #26485

via Isaac Schlueter.

--

View Session [Sentry]

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 55b81fd (PR test merge using develop at ed94112)

Against: 452f91e (develop) · base run #66586

⚠️ Baseline mismatch: 23 develop commit(s) in the PR build are missing from the baseline; 6 develop commit(s) in the baseline are missing from the PR build. Their size changes also affect this comparison. Compare commits. Rebase your PR onto the latest develop to compare against an up-to-date baseline.

Path Size % Change Change
@sentry/browser 30.18 kB - -
@sentry/browser - with treeshaking flags 28.38 kB +0.01% +1 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 28.28 kB - -
@sentry/browser (incl. Tracing) 52.74 kB - -
@sentry/browser (incl. Tracing Core) 40.27 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.75 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.63 kB - -
@sentry/browser (incl. Tracing, Replay) 92.79 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.61 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.16 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 110.39 kB - -
@sentry/browser (incl. Feedback) 47.8 kB - -
@sentry/browser (incl. sendFeedback) 30.76 kB - -
@sentry/browser (incl. FeedbackAsync) 35.76 kB -0.01% -2 B 🔽
@sentry/browser (incl. Metrics) 31.5 kB - -
@sentry/browser (incl. Logs) 31.78 kB - -
@sentry/browser (incl. Metrics & Logs) 32.44 kB +0.01% +1 B 🔺
@sentry/react 32.19 kB - -
@sentry/react (incl. Tracing) 55.39 kB - -
@sentry/vue 38.38 kB - -
@sentry/vue (incl. Tracing) 55.69 kB -0.01% -1 B 🔽
@sentry/svelte 30.19 kB - -
@sentry/remix (Remix 3 client bundle) 58.4 kB - -
CDN Bundle 32.11 kB - -
CDN Bundle (incl. Tracing) 53.15 kB - -
CDN Bundle (incl. Logs, Metrics) 34.89 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.71 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 75.92 kB - -
CDN Bundle (incl. Tracing, Replay) 91.03 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.65 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 96.42 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.98 kB - -
CDN Bundle - uncompressed 93.8 kB - -
CDN Bundle (incl. Tracing) - uncompressed 157.13 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 102.13 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 164.75 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 232.25 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 277.28 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 284.91 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 289.07 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 296.69 kB - -
@sentry/nextjs (client) 59.09 kB +0.13% +72 B 🔺
@sentry/sveltekit (client) 54.08 kB +0.1% +53 B 🔺
@sentry/core/server 44.8 kB -0.54% -242 B 🔽
@sentry/core/browser 14.4 kB - -
@sentry/node 151.73 kB -0.19% -274 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.34 kB - -
@sentry/node - without tracing 88.67 kB -0.01% -3 B 🔽
@sentry/node - without channel injection 140.69 kB -0.18% -248 B 🔽
@sentry/aws-serverless 99.04 kB -0.01% -2 B 🔽
@sentry/cloudflare (withSentry) - minified 206.95 kB - -
@sentry/cloudflare (withSentry) 480.37 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 232.31 kB - -

View base workflow run

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

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

Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 50s Details
✅ CI: Optional E2E Tests / E2E solidstart-2-tunnel Test (optional) Successful in 44s Details

The bundler plugin wrote the release into the startup chunks of the client
build. As the release defaults to the git SHA, every commit changed their
content hashes, and the renames spread to every chunk importing them.

The server now adds `<meta name="sentry-release">` to each page (a Nitro
plugin on SolidStart 1, a Nitro middleware on SolidStart 2), the client
`init` reads it when no `release` is passed, and the client build no longer
injects the release. Server builds still inject it. `release.inject: false`
turns the meta tag off as well.

Ref: #26485
Co-Authored-By: Isaac Schlueter <isaac.schlueter@sentry.io>
@sentry-junior
sentry-junior Bot force-pushed the fix/solidstart-release-runtime branch from fdbab02 to 22d336a Compare November 17, 2026 19:20

@isaacs isaacs 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.

The design is good. It reaches SSR, SPA (prerendered index.html) and static output on both SolidStart majors through the server, with no inline script, so there is no CSP impact. It keeps server release injection unchanged.

This is ready to land.

My answers to the open decisions in the description:

  • SolidStart 1 precompressed copies under .output/public: I agree that this can stay. Browsers never request server chunks, so their hashes do not affect caching.
  • Two plugin instances, release finalize and deploy running twice: newDeploy is guarded by the module-level _deployedReleases set in packages/bundler-plugins/src/core/build-plugin-manager.ts, so the deploy record is created once across instances. Release create, finalize and set-commits run once per build, each with their own build plugin manager. Vinxi already ran three separate builds through one instance before this PR, and the Sentry API treats repeat create and finalize calls as no-ops, so the second instance adds API calls but no duplicate data.
  • Body rewriting (64 KiB buffer, encoded bodies skipped, content-length dropped): this is fine.

Optional notes:

  • packages/solidstart/src/nitro/releaseMiddleware.ts only rewrites a Response. If a SolidStart 2 handler ever returns a string or a stream for an HTML page, the page gets no tag and the client gets no release, without a warning. The E2E tests show that the current SolidStart 2 returns a Response. A debug log for HTML that was not rewritten would make a future change in that visible.
  • The SolidStart 1 plugin handles string and web ReadableStream bodies, but not a Node.js Readable. That also passes through untouched. The E2E app covers the default setup.
  • This is the fifth copy in the stack of the sentry-release meta tag reader and of escapeAttribute. The browser SDK reading the tag itself, which I suggested on #26508, would remove the client copies.

@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.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 22d336a. Configure here.

This branch has not been deployed

No deployments
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.

1 participant