Short answer
Set "public" in firebase.json to the folder your build writes, such as dist or build/web, run the build, then deploy again. If the home page works but other routes fail on refresh, add a rewrite of "**" to "/index.html". If the screen says Site Not Found instead, the site or custom domain usually has no live deploy yet, or the domain isn’t connected.
Rather not fix it yourself? App Fix Ticket starts with a fixed-price diagnosis, then a fixed price for the fix before any fix work.
Why the page is not found, and the fix
01
public points at the wrong folder
“The public attribute specifies which directory to deploy to Firebase Hosting.” Firebase, Configure Hosting behavior
firebase init sets public to a folder called public, but most build tools write elsewhere: dist for Vite, dist/<project> for Angular, build for Create React App, out for a Next.js static export, build/web for Flutter. Firebase deploys whatever that folder holds. If you left the default public folder, you may see Firebase’s welcome page instead of your app. If the folder is missing, the deploy fails with a public directory error. A folder without index.html gives Page Not Found.
{ "hosting": { "public": "dist", "ignore": ["firebase.json", "**/.*", "**/node_modules/**"] } }02
The build didn’t run before deploy
firebase deploy uploads the folder as it is. Run the build first, check that index.html is in the folder, then deploy. In CI, run both steps in the same job.
npm run build && ls dist/index.html && firebase deploy --only hosting03
Routes work by clicking but not on refresh
“You can also use rewrites to support apps that use HTML5 pushState for navigation.” Firebase, Configure Hosting behavior
React Router, Vue Router and Flutter web handle routes in the browser. A refresh asks Hosting for a file like /dashboard, which doesn’t exist. Add a rewrite that serves index.html for every path without a file.
"rewrites": [ { "source": "**", "destination": "/index.html" } ]04
Another rule matches first
“Within each of the redirects and rewrites attributes, Hosting applies the redirect or rewrite defined by the first rule with a URL pattern that matches the requested path.” Firebase, Configure Hosting behavior
Rules run top to bottom, and the first match wins. A broad rewrite above a function or API rewrite sends those requests to the wrong place. Put the specific rules first and the "**" rewrite last.
Checked against the vendor’s docs on : Firebase docs: Configure Hosting behavior.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
“Very responsive, attentive to fixing bugs, and completed the project as needed! Thank you!”
Related: “Page Not Found” on refresh on Netlify or Vercel · Firebase Cloud Functions CORS error · Firebase Storage unauthorized · Firebase Storage object-not-found