Minimal reproduction for a Fast Refresh / HMR bug in TanStack Start's RSC mode.
pnpm install
pnpm dev:vite # http://localhost:3000- Open http://localhost:3000.
- Click Increment once (so
Count: 1) — this seeds client state. - Edit
src/routes/index.tsxand change the<h1 data-testid="marker">text (edit-me-baseline→ anything) and save. - Bug: the heading does not update in the browser. The terminal shows
only
(rsc) hmr update /src/routes/index.tsx?tss-serverfn-split— no client update — and there is no full reload either.
For contrast, move getServerData (the createServerFn) into its own file and
import it back into index.tsx: HMR then works and the heading updates while the
counter is preserved.
The same app runs under the rsbuild adapter from the identical src/:
pnpm dev:rsbuild # http://localhost:3000Doing the same edit Fast Refreshes correctly — the heading updates and the
counter is preserved. rsbuild's RSC mode uses rspack + @rsbuild/plugin-react
Fast Refresh and has no equivalent of the @vitejs/plugin-rsc client
hotUpdate guard, so the bug is vite-only. This corroborates that the fix
belongs in @vitejs/plugin-rsc, not in TanStack Start's shared code.
The route file contains a createServerFn, so it's present in the rsc module
graph. @vitejs/plugin-rsc's client hotUpdate hook returns [] for any file
in the rsc graph that isn't inside a "use client" boundary (a guard meant to
avoid full reloads from server-only files watched as style deps, e.g. Tailwind).
The route component is a genuine client module (imported by the client route
tree) but isn't a "use client" reference, so its client HMR is wrongly
suppressed.
Proposed fix upstream: vitejs/vite-plugin-react#1248
@tanstack/react-start^1.168.25@vitejs/plugin-rsc^0.5.27 (vite lane)@rsbuild/core^2 +@rsbuild/plugin-react^2 (rsbuild lane)vite^8react19