Skip to content

fix(tanstackstart-react): Keep parametrized route names in Nitro 3 builds - #25307

Merged
JPeer264 merged 1 commit into
developfrom
jp/tanstackstart-latest-vite-8
Oct 13, 2026
Merged

JPeer264 merged 1 commit into
developfrom
jp/tanstackstart-latest-vite-8

Conversation

@JPeer264

@JPeer264 JPeer264 commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

closes #25305
closes JS-3920

Description

This makes the Vite plugin bundle @sentry/tanstackstart-react into server builds, so server spans keep parametrized names like GET /param/$id with the current Nitro 3. It also fixes the e2e builds that broke with TanStack Start 1.169:

  • The tanstackstart-react (latest) canary build now also installs the latest Nitro, Vite and Vite plugins.
  • tanstackstart-react-cloudflare moves 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_modules instead of bundling it, so the route patterns that our plugin writes into the SDK file never reach the server.

Test decisions

The normal tanstackstart-react run 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&timestamp=1791873042

After, server span named GET /param/$id: https://sentry-sdks.sentry.io/explore/traces/trace/715f58fb9cf3470eaa235a2ad7abff73/?node=span-b4454064fab142bc&project=4510555608449024&source=traces&targetId=b4454064fab142bc&timestamp=1791873013

…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>
@linear-code

linear-code Bot commented Oct 13, 2026

Copy link
Copy Markdown

JS-3920

@JPeer264
JPeer264 marked this pull request as ready for review October 13, 2026 06:59
@JPeer264
JPeer264 requested a review from a team as a code owner October 13, 2026 06:59
@JPeer264
JPeer264 requested review from nicohrubec and s1gr1d and removed request for a team October 13, 2026 06:59
@JPeer264 JPeer264 self-assigned this Oct 13, 2026

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

thanks for fixing

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

passt

@JPeer264
JPeer264 merged commit 8b46546 into develop Oct 13, 2026
48 checks passed
@JPeer264
JPeer264 deleted the jp/tanstackstart-latest-vite-8 branch October 13, 2026 08:43
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.

tanstackstart-react (latest) Test Failed

3 participants