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
vite dev: RELOAD_WAIT_TIMEOUT (30 s) is hard-coded; large SSR graphs still 503 on cold start #4687
nitro 3.0.260903-beta, vite 8.2.1, @tanstack/react-start1.168.52
Node 24.12.0, Windows 11, nitro({ preset: 'bun' })
Problem
#4541 (released in 3.0.260903-beta, closing #4295) made ViteEnvRunner.fetch wait for the in-flight reload instead of giving up after about 3 s. That fixed the problem for small apps. The wait is still capped by a hard-coded constant, though:
Our app is TanStack Start with workspace packages aliased to source. Its SSR entry pulls in about 5,000 modules (counted with NITRO_DEBUG=1). The first import on a cold vite dev takes 23–37 s on this machine. Whenever it goes past 30 s, the first request logs:
Vite environment "ssr" did not finish reloading within 30000ms.
NitroViteError: Vite environment "ssr" is unavailable (503)
The import keeps running and later requests succeed, so the only thing that failed is the wait.
Measurements (first request to a page, sent as soon as Vite reports ready)
Setup
First response
3.0.260311-beta
503 after about 3 s, every cold start
3.0.260903-beta
200 in 23–30 s most runs; 503 after 30 s on slower runs
3.0.260903-beta with the constant set to 120 000
200 in 23.3 / 23.3 / 29.6 s (3 of 3), no 503s
Request
Make the dev reload wait configurable, for example a dev option or an env var such as NITRO_DEV_RELOAD_TIMEOUT, or raise the default. Most requests during a cold start arrive before the SSR entry exists, and since the import is already in flight, a longer wait costs nothing.
Related: #4638. The same cold-start window on Windows also hits the createServiceEnvironment registration race described there (a getBuiltins invoke is dropped and SSR stays wedged until restart). Registering the service env after createFetchableDevEnvironment resolves, the same order createNitroEnvironment uses, made that go away for us.
Activity