Skip to content

fix(dev): let SPA Vite builds exit after prerendering - #15429

Open
Fnine59 wants to merge 5 commits into
remix-run:mainfrom
Fnine59:fix/react-router-vite-exit-15427
Open

fix(dev): let SPA Vite builds exit after prerendering#15429
Fnine59 wants to merge 5 commits into
remix-run:mainfrom
Fnine59:fix/react-router-vite-exit-15427

Conversation

@Fnine59

@Fnine59 Fnine59 commented Aug 21, 2026

Copy link
Copy Markdown

What changed

A direct vite build in SPA mode completed its output but kept running because the internal prerender preview closed its HTTP server without closing the React Router plugin resources created while resolving the preview config.

Wrap the preview server's idempotent close() method so callers also await cleanup of the plugin's child compiler, config loader, and typegen watcher. Normal watcher behavior while a preview server is running is unchanged.

Tests

Added a focused SPA integration regression that invokes the Vite CLI directly and requires it to exit naturally after prerendering instead of using the React Router CLI's explicit process exit.

Fixes #15427

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vite build never exits in SPA mode with React Router 8

2 participants