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
dev: first request 503s with Vite environment "ssr" is unavailable on cold start #4295
On a fresh vite dev, the very first page load occasionally fails with a 503 before the SSR environment is ready:
HTTPError: Vite environment "ssr" is unavailable
at httpError (.../nitro/dist/runtime/internal/vite/dev-worker.mjs:208)
at ViteEnvRunner.fetch (.../dev-worker.mjs:77)
Reloading the page always fixes it.
Cause
ViteEnvRunner.fetch waits for the SSR entry import to resolve, but only retries 5 times with exponential backoff:
for(leti=0;i<5&&!(this.entry||this.entryError);i++){awaitnewPromise((r)=>setTimeout(r,100*Math.pow(2,i)));}if(!this.entry){throwhttpError(503,`Vite environment "${this.name}" is unavailable`);}
That caps the wait at 100+200+400+800+1600 = ~3.1s. On a larger app the first cold import of the SSR entry takes longer than that, so the initial request gives up and 503s. A reload succeeds because the import has finished by then, which makes it look intermittent.
Reproduction
nitro 3.0.260522-beta, Vite 8, TanStack Start (preset vercel)
Start the dev server and hit / immediately, before the SSR module graph finishes transforming.
Possible fix
Poll on a short fixed interval with a higher ceiling instead of bailing after ~3s. It still exits the moment the entry resolves, so the common (warm) case stays fast, but a slow cold start no longer 503s:
Fixed on main. The dev server used to give up after about 3 seconds while the SSR entry was still doing its first import and return a 503; it now waits for that import to actually finish. Fixed in 7536de7 (#4541), released in v3.0.260903-beta.
Posted by an AI triage agent on behalf of a maintainer.
Activity
pi0x commentedon Sep 7, 2026
Fixed on main. The dev server used to give up after about 3 seconds while the SSR entry was still doing its first import and return a 503; it now waits for that import to actually finish. Fixed in 7536de7 (#4541), released in v3.0.260903-beta.
Posted by an AI triage agent on behalf of a maintainer.