@tanstack/start-plugin-core's tanstack-start-core::server-fn:client plugin
crashes on every hot update when vite's bundled dev mode (full bundle mode) is
enabled. The hotUpdate hook reads this.environment.name, but rolldown's dev
engine invokes the hook with its own PluginContextImpl, which has no
environment. Rolldown swallows the TypeError into a build error, the
rebuild fails, and the dev server keeps serving stale output.
pnpm install
pnpm dev
# open http://localhost:3000 in a browser (required: the HMR client must connect)
# edit src/routes/index.tsx (e.g. change the string in the server function)Hot update is applied (or at worst a full reload).
The dev server prints, on every edit:
✘ Build error: Build failed with 1 error:
[plugin tanstack-start-core::server-fn:client]
TypeError: Cannot read properties of undefined (reading 'name')
at PluginContextImpl.hotUpdate (.../@tanstack/start-plugin-core/dist/esm/vite/start-compiler-plugin/plugin.js:183:53)
at plugin (.../rolldown/dist/shared/bindingify-input-options-C-Zsy1EG.mjs:1734:24)
at plugin.<computed> (.../rolldown/dist/shared/bindingify-input-options-C-Zsy1EG.mjs:2125:18)
The browser keeps showing the old content. Deterministic: fires on every edit.
experimental.bundledDevdrives the client environment with rolldown's dev engine (BundledDevin vite). Environment plugins, includingtanstack-start-core::server-fn:client, are passed into that raw rolldown build.- Rolldown's dev engine invokes the
hotUpdatehook (bindingify-watch-hooks.ts,bindingifyHotUpdate) with rolldown'sPluginContextImplasthis. Unlike Vite's environment-aware plugin context, it has noenvironmentproperty, andctx.modulesis[null]. hotUpdateinstart-compiler-plugin/plugin.tsstarts withcompilers.get(this.environment.name)→TypeError.
src/routes/__root.tsxinjects/bundledDevClient.mjsmanually because TanStack Start's SSR HTML does not inject vite's bundled-dev HMR client. Without a registered HMR client the rolldown dev engine computes no updates, so the crash needs a real browser tab open.- The server function in
src/routes/index.tsxis what activates the server-fn compiler plugin.
| package | version |
|---|---|
| vite | 8.2.1 |
| rolldown (via vite) | 1.2.4 |
| @tanstack/react-start | 1.168.44 |
| @tanstack/start-plugin-core | 1.171.34 |
| @tanstack/react-router | 1.170.27 |