Repository navigation
fix(tanstackstart-react): Keep parametrized route names in Nitro 3 builds - #25307
Merged
Merged
Conversation
…ilds The Vite plugin injects the route patterns into the SDK's own `wrapFetchWithSentry` file at build time. Vite externalizes dependencies in server builds, and current Nitro 3 releases copy external dependencies into `.output/server/node_modules` instead of bundling them. The transform then never sees the SDK file, so route parametrization turned off and server spans were named only after the HTTP method. The plugin now adds `@sentry/tanstackstart-react` to `resolve.noExternal` of the server environments in builds, so the SDK is always bundled. The canary build of the e2e app now also installs the latest Nitro, Vite, React SWC plugin and `vite-tsconfig-paths`. TanStack Start 1.169, the first stable release, needs Vite 8, and the build kept Vite 7.3.2. It also kept `nitro@3.0.0`, the old placeholder release that `latest || *` resolves to, which answers every request with a 500 on 1.169. The `tanstackstart-react-cloudflare` app accepts any TanStack Start 1.x, so it installed 1.169 with Vite 7.3.2 and its build failed too. It now uses Vite 8 with the matching `@vitejs/plugin-react` and `vite-tsconfig-paths`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JPeer264
marked this pull request as ready for review
October 13, 2026 06:59
JPeer264
requested review from
nicohrubec and
s1gr1d
and removed request for
a team
October 13, 2026 06:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #25305
closes JS-3920
Description
This makes the Vite plugin bundle
@sentry/tanstackstart-reactinto server builds, so server spans keep parametrized names likeGET /param/$idwith the current Nitro 3. It also fixes the e2e builds that broke with TanStack Start 1.169:tanstackstart-react (latest)canary build now also installs the latest Nitro, Vite and Vite plugins.tanstackstart-react-cloudflaremoves to Vite 8 (as this test is using the latest minor).Why
TanStack Start 1.169, the first stable release, needs Vite 8, so builds on Vite 7.3.2 failed. With Vite 8, the current Nitro copies the SDK into
.output/server/node_modulesinstead of bundling it, so the route patterns that our plugin writes into the SDK file never reach the server.Test decisions
The normal
tanstackstart-reactrun keeps TanStack Start 1.168 with Vite 7, so only the nightly canary runs the new Nitro. We can move its pins to 1.169 at any time, to test the fix on every PR, but that drops the 1.168 coverage.Sentry traces
Before, server span named
GET: https://sentry-sdks.sentry.io/explore/traces/trace/0e6c6d8167f14675a7ff464b6e20cc0d/?node=span-850e1cc693d955b7&project=4510555608449024&source=traces&targetId=850e1cc693d955b7×tamp=1791873042After, server span named
GET /param/$id: https://sentry-sdks.sentry.io/explore/traces/trace/715f58fb9cf3470eaa235a2ad7abff73/?node=span-b4454064fab142bc&project=4510555608449024&source=traces&targetId=b4454064fab142bc×tamp=1791873013