3

I deployed my React app to Firebase Hosting, and the deployment logs indicate success, but accessing the hosting URL shows a "Site Not Found" error. The build is performed correctly, as it's running fine on my local server build.

enter image description here

Verified firebase.json:

{
 "hosting": {
 "public": "dist",
 "ignore": [
 "firebase.json",
 "**/.*",
 "**/node_modules/**"
 ],
 "rewrites": [
 {
 "source": "**",
 "destination": "/index.html"
 }
 ]
 }
}

Troubleshooting Performed:

  1. I checked the Firebase Console under "Releases", and the latest version has been deployed.
  2. Cleared browser cache and tested in incognito mode.
  3. Cleared Firebase Hosting cache by deleting the existing site version and redeploying:

firebase deploy --only hosting

  1. Confirmed the build folder contains all necessary files.

enter image description here

Verified Vite.config.json

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
// https://vite.dev/config/
export default defineConfig({
 base: "/",
 plugins: [react(), tailwindcss()],
 build: {
 outDir: "dist", // Or whatever directory you choose
 },
});

Environment:

What else should I check to resolve this issue?

asked Apr 18, 2025 at 13:38
8
  • I am confused with your URL, the screenshot shows http://netflix-gpt-47dd8.web.app/ and the website opens up for me but you have mentioned https://netflixgpt-fadcf.web.app/ in your question. Have you rechecked your project ID and hosting URL in Firebase console? Commented Apr 18, 2025 at 19:09
  • Hey, I've updated the screenshot. Can you check now? I've checked on the Firebase console, the link I've mentioned is correct, but the site is not coming live Commented Apr 19, 2025 at 8:58
  • Add the base URL in vite.config.ts. Commented Apr 19, 2025 at 10:26
  • Yes, I already did that and tried to redeploy, but the "Site not found" message was still there. Commented Apr 19, 2025 at 11:21
  • likely a simple problem, on firebase.json, could you try to change "public": "dist", to "public": "public",, then remove the "rewrites", then add a dummy index.html on public folder, then deploy it? If that still shows the site not found message, likely you deployed to wrong project. You can also try to use the same code and deploy it to another dummy firebase project and see if it works Commented Apr 22, 2025 at 4:58

1 Answer 1

0

This is expected to be resolved by checking the settings in firebase.json. Please check the following points.

"public": "dist"

Please make sure that static files such as index.html are placed directly under the "dist" folder. If not, fix "dist" to the correct path.

answered Apr 24, 2025 at 2:37
Sign up to request clarification or add additional context in comments.

2 Comments

As you can see, index.html is directly under the dist folder
Okay, did you try to clear remote cache? Please check following url. stackoverflow.com/questions/46667316/…

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.