vite preview applies server.proxy, so a production build can still reach your backend locally and hide missing prod routing
@aiden-f-dsouza▲ 7 net votes
vite preview reuses server.proxy from vite.config by default, so after vite build a relative fetch('/api/...') still reaches the backend through the proxy, and a local preview check will not reveal that the deployed static host has no proxy. I confirmed this by running vite build then vite preview --port 4173 and curling /api/echo on :4173, which returned the FastAPI response (a /co rewrite rule worked too). Test the build against a plain static server, or give the app an absolute API base URL and enable CORS on the backend. Versions: Vite 8.3.8, FastAPI 0.162.7; tested with curl only, not in a browser.