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
instanceof RunnableDevEnvironment fails with vite-plus alias #7218
please provide a reproducer that can be cloned directly without having to execute any more installation. also try different package managers to find out if it depends on that
you can clone what i linked above directly, but yeah it is an issue with vite+ specifically. Using npm or bun to start thr vite server does fine. However since the fix for the issue is in tanstack router code and not in vite-plus code i opened the issue here.
Reproduction simply involves git cloning the above, installing vite-plus, cd into it and then do vp run.
Corroborating data point from a different setup (npm workspaces, not the OP's global vite-plus install), in case it helps move this out of "information needed".
Environment
npm workspaces monorepo (not pnpm/bun), vite aliased to vite-plus via root overrides: "vite": "npm:@voidzero-dev/vite-plus-core@latest"
@tanstack/react-start SSR app, vp dev
Reproduces identically against [email protected], 1.168.14, and with [email protected]; also against [email protected]/0.1.21/0.1.22 and plain npx vite (vite 8.0.14). The @tanstack/* version is not the variable — the vite-plus alias is.
Symptom: vp dev boots fine but every route returns 404 Cannot GET /. vite dev (real vite) works.
Where it bails — start-plugin-core/dist/esm/vite/dev-server-plugin/plugin.js:
if(installMiddleware==void0){if(viteDevServer.config.server.middlewareMode)return;if(!isRunnableDevEnvironment(serverEnv)||"dispatchFetch"inserverEnv)return;// ← silent bail, no log}
Under the vite-plus alias the SSR environment isn't recognized as a RunnableDevEnvironment, so the dev middleware is never installed and every request 404s. Note the bail is silent — there's no warning, which is what makes this hard to diagnose. The throw a few lines down (cannot install vite dev server middleware ... not a RunnableDevEnvironment) is never reached because of the early return.
Workaround that works for us — a pre plugin that forces the SSR env to be Runnable, using createRunnableDevEnvironment resolved through the same (aliased) vite specifier:
With this, the middleware installs and SSR HTML is served (HTTP 200) under vp dev.
Two possible upstream fixes, fwiw:
Have start-plugin-core set environments.ssr.dev.createEnvironment = createRunnableDevEnvironment itself when configuring the SSR env (it currently sets consumer: 'server' but doesn't pin the dev environment factory), so it doesn't depend on the host's default being Runnable.
Expose installDevServerMiddleware to the vite plugin config (today only the rsbuild path reads it per schema.js), so users can opt in without patching the package.
Happy to provide a minimal npm-workspaces reproducer if useful.
Activity
schiller-manuel commentedon Apr 18, 2026
please provide a reproducer that can be cloned directly without having to execute any more installation. also try different package managers to find out if it depends on that
ultra2207 commentedon Apr 18, 2026
you can clone what i linked above directly, but yeah it is an issue with vite+ specifically. Using npm or bun to start thr vite server does fine. However since the fix for the issue is in tanstack router code and not in vite-plus code i opened the issue here.
Reproduction simply involves git cloning the above, installing vite-plus, cd into it and then do vp run.
schiller-manuel commentedon Apr 18, 2026
why dont you install vite-plus then in the repo? it might matter which package manager you use for that step.
ultra2207 commentedon Apr 18, 2026
the regular vp install using irm https://vite.plus/ps1 | iex installs globally, not in the repo. Also just putting it in the repo wont work as its different for windows/mac/linux. Not to mention adding to path which the command does automatically.
ultra2207 commentedon Apr 19, 2026
yo
roll commentedon May 26, 2026
It seems to be we are running into the same, a mostly empty Tanstack Start app does work with
vite devand 404 on any route withvp dev(pnpm managed)kevinkod commentedon Jun 8, 2026
Corroborating data point from a different setup (npm workspaces, not the OP's global vite-plus install), in case it helps move this out of "information needed".
Environment
vitealiased to vite-plus via rootoverrides:"vite": "npm:@voidzero-dev/vite-plus-core@latest"@tanstack/react-startSSR app,vp dev[email protected],1.168.14, and with[email protected]; also against[email protected]/0.1.21/0.1.22and plainnpx vite(vite 8.0.14). The@tanstack/*version is not the variable — the vite-plus alias is.Symptom:
vp devboots fine but every route returns404 Cannot GET /.vite dev(real vite) works.Where it bails —
start-plugin-core/dist/esm/vite/dev-server-plugin/plugin.js:Under the vite-plus alias the SSR environment isn't recognized as a
RunnableDevEnvironment, so the dev middleware is never installed and every request 404s. Note the bail is silent — there's no warning, which is what makes this hard to diagnose. Thethrowa few lines down (cannot install vite dev server middleware ... not a RunnableDevEnvironment) is never reached because of the earlyreturn.Workaround that works for us — a
preplugin that forces the SSR env to be Runnable, usingcreateRunnableDevEnvironmentresolved through the same (aliased)vitespecifier:With this, the middleware installs and SSR HTML is served (HTTP 200) under
vp dev.Two possible upstream fixes, fwiw:
start-plugin-coresetenvironments.ssr.dev.createEnvironment = createRunnableDevEnvironmentitself when configuring the SSR env (it currently setsconsumer: 'server'but doesn't pin the dev environment factory), so it doesn't depend on the host's default being Runnable.installDevServerMiddlewareto the vite plugin config (today only the rsbuild path reads it perschema.js), so users can opt in without patching the package.Happy to provide a minimal npm-workspaces reproducer if useful.
qeeqez commentedon Jul 11, 2026
similar issue for the Vite 8 release - #7614
schiller-manuel commentedon Sep 7, 2026
fixed upstream voidzero-dev/vite-plus#1391