We build OnScene , a live shopping app for Pakistan. Its marketing site, blog and policy pages are a Vite + React single-page app hosted on Firebase Hosting. For a long time every URL on it returned the same empty index.html . This post is about how we fixed that without migrating to Next.js: a build-time prerender step, a few build gates, and some Firebase Hosting configuration. It also covers the two bundling mistakes that bit us along the way.
The problem: one shell for every URL
A client-rendered SPA serves one HTML file for every route. That file has one <title> , one description, no <h1> and no body text. Googlebot renders JavaScript eventually, but plenty of consumers do not: Bing's indexing was inconsistent for us, most AI crawlers fetch raw HTML, and WhatsApp, X and LinkedIn link previews never run your JS. For all of them, our 30-odd public pages looked like one page repeated.
The usual answer is "move to Next.js or Astro".…