You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Start + Rsbuild: SPA mode dev server SSRs routes and runs loaders on the server #8543
// src/routes/index.tsxexportconstRoute=createFileRoute('/')({loader: ()=>(typeofwindow==='undefined' ? 'server' : 'client'),component: ()=><p>loader ran on the {Route.useLoaderData()}</p>,})
Run rsbuild dev, then curl localhost:3000/.
Expected
Shell only (no route markup), with the loader running on the client, same as vite dev.
Actual
The response contains <p>loader ran on the <!-- -->server</p>.
Possible fix
The Vite plugin defines TSS_SHELL in serve mode (vite/planning.ts#L154-L156). The Rsbuild source.define block (rsbuild/plugin.ts#L205-L246) doesn't, so IS_SHELL_ENV in createStartHandler.ts is always false. Adding process.env.TSS_SHELL / import.meta.env.TSS_SHELL there when isDev fixes it. If #8137 lands first, the key also belongs in its enforcedDefineConfig.
Workaround
In dev, set environments.ssr.source.define to { 'process.env.TSS_SHELL': '"true"', 'import.meta.env.TSS_SHELL': '"true"' }.
Versions
@tanstack/react-start 1.168.59 (start-plugin-core 1.171.48), @rsbuild/core 2.2.10, Node 24.16. Still present on main at 41ebd28.
Activity
fix(start-plugin-core): Rsbuild dev honours SPA mode and server.compress
fix(start-plugin-core): define TSS_SHELL in Rsbuild dev for SPA mode (T…