انتقل إلى المحتوى
المدونة

Firebase Hosting "Site Not Found" after a successful deploy

Firebase deploy says it worked, but your web.app URL shows "Site Not Found". Check the public folder, the build, the site ID and deploy target, step by step.

The Liite team7 دقيقة قراءة

Short answer

A successful deploy only means files were uploaded, not that they are the right files. Open firebase.json, set hosting.public to the folder your build really produces (dist for Vite, build for Create React App, build/web for Flutter web), run the build, and deploy again. If that doesn't fix it, check that you deployed to the same site you are visiting.

You run firebase deploy --only hosting, the terminal prints "Deploy complete!", and the web.app address shows "Site Not Found" or a plain 404. Some people hit this on a brand-new project, and some on a site that had run fine for months.

Site Not Found

Why it happens

The CLI uploads whatever folder firebase.json names under hosting.public and reports success when the upload works. It does not check that the folder holds a working site. A React, Vite or Flutter project produces nothing serveable until you build it, so a deploy can succeed while serving nothing useful.

The causes, most common first:

  1. public points at the wrong folder. The CLI default is public, but your build writes somewhere else.
  2. The build didn't run before the deploy. The output folder is empty or stale.
  3. No index.html at the top level of the deployed folder, for example because the build output sits one level deeper.
  4. You deployed to a different site or project than the address you are visiting.
  5. A site-level change in the console, such as a deleted or disabled site, or a custom domain that was disconnected.
  6. Unknown. Threads we read describe sites that worked for months and then broke with no code change. Those went unanswered, so we can't name a confirmed cause for them.
CauseSymptomFix
Wrong public valueDeploy uploads 1 or 2 filesPoint public at the build folder
Build skippedOld or empty contentRun the build before each deploy
No top-level index.html404 on /Fix the output path or the build base
Wrong site or projectYour site is fine in the console, URL still 404sCheck the active project and site ID
Console-side changeWorked before, no code changeCheck Hosting in the console, then contact support

Step-by-step fixes

1. Match public to your build output

  1. Open firebase.json and find the hosting section.
  2. Read the public value.
  3. Compare it with the folder your build tool writes. Typical values: dist (Vite), build (Create React App), build/web (Flutter web). For anything else, check the tool's build settings.
{
  "hosting": {
    "public": "dist",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
  }
}

2. Build first, then deploy

Run your project's build command before every deploy, then confirm the output exists. A one-line habit that prevents stale deploys:

npm run build && firebase deploy --only hosting

For Flutter web, use flutter build web instead.

3. Look inside the output folder

Open the folder named in public and confirm index.html sits at its top level, not inside a nested subfolder. If it is nested, either change public to the inner folder or fix the build's output setting. The deploy log lists how many files were uploaded. A count of 0, 1 or 2 usually means the folder is empty or is still the default placeholder.

Warning

Running firebase init hosting again can overwrite public and may offer to replace index.html. Answer "No" to overwriting if you already have a built index.html you want to keep.

4. Check you deployed to the right project and site

If your account has several projects, or one project has several hosting sites, the CLI may have pushed to a different one than the address you are visiting.

  1. Run firebase projects:list and firebase use to see which project is active.
  2. In the Firebase console, open Hosting and compare the site and domain listed there with the URL you are testing.
  3. If you use multiple sites, check the site or target entries in firebase.json and .firebaserc, and deploy with the matching target, for example firebase deploy --only hosting:your-target.

5. Rule out caching and the wrong URL

Reload in a private window. Then test the default web.app or firebaseapp.com address, not your custom domain. Those default addresses don't depend on your own DNS records, so if they show your site but the custom domain doesn't, the problem is the domain connection, not the deploy.

6. Single-page apps: rewrites

If / works but deep links such as /dashboard return 404, add a rewrite so unknown paths serve index.html:

"rewrites": [
  { "source": "**", "destination": "/index.html" }
]

Do this only after you've confirmed index.html is in the deployed folder. A rewrite can't serve a file that isn't there.

7. The site worked before and broke on its own

Open Hosting in the console and look at the release history and the status of your domains. Check that the release you expect is marked live; rolling back to a previous release is possible from that page. Also check Firebase's status page for an incident. If nothing in your setup changed and the console looks right, go to the support steps below.

Note

We can't point to a confirmed vendor-side cause for the "suddenly stopped working" reports, so treat steps 1 to 6 as things to rule out rather than a guaranteed fix.

Checklist before you try again

  • hosting.public names the folder your build writes.
  • You ran the build just before deploying.
  • index.html is at the top level of that folder.
  • The deploy log shows a sensible number of files.
  • The active CLI project matches the project in the console.
  • You are testing the site's default web.app address in a private window.

What won't help

  • Deploying the same thing again and again. If the folder is wrong or empty, every deploy succeeds and every page stays missing.
  • Waiting for DNS to propagate when you are visiting the default web.app address.
  • Reinstalling the CLI. The upload worked; the content is the problem.

If nothing works

Contact Firebase support through the support option in the Firebase console, or use the vendor's community forum for peer help. Include your project ID, site ID, the exact URL, the time of the last deploy, the deploy log, and your firebase.json. Mention what you already tried.

Subject: Hosting shows "Site Not Found" after a successful deploy

Project ID: <your-project-id>
Site ID: <your-site-id>
URL: https://<your-site>.web.app
Last deploy: <date and time with time zone>

firebase deploy --only hosting reports "Deploy complete!", but the URL
shows "Site Not Found".

Already checked: hosting.public points at <folder>, index.html is at the
top level, the build ran before deploying, the active CLI project matches
the console, and I tested in a private window.

Deploy log and firebase.json are attached. Can you check the site's
release state on your side?

If you only need the built site online

If all you need is a finished build on a URL, Liite can serve the built folder without any CLI config. Upload the output folder or a zip of it as an uploaded site, with index.html at the top level or inside a single wrapper folder, and it goes live at <slug>.liite.site. There is a single-page-app setting that sends unknown paths to index.html. Liite doesn't run builds or server-side code, so you build locally first, and it doesn't replace Firebase's other services. A Free uploaded site needs a card on file and goes offline 7 days after the last publish. See uploaded sites or putting an HTML file, zip or PDF online.

Common questions

Why does the deploy succeed if the site is empty?

The CLI checks that the upload works, not that the folder is a real site. An empty or wrong folder uploads without errors.

Can a custom domain cause "Site Not Found" when the web.app URL works?

Yes. If the default address works, your files are fine and the issue is the domain connection. Check the domain's status in the Hosting section of the console.

Do I need to build before every deploy?

Yes, for React, Vite and Flutter projects. The deploy uploads the output folder as it is, so a stale build means stale content.

Should public ever point at my source folder?

No, unless the source folder is itself a finished static site. For framework projects it should point at the build output.