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.
Verified firebase.json:
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
Troubleshooting Performed:
- I checked the Firebase Console under "Releases", and the latest version has been deployed.
- Cleared browser cache and tested in incognito mode.
- Cleared Firebase Hosting cache by deleting the existing site version and redeploying:
firebase deploy --only hosting
- Confirmed the build folder contains all necessary files.
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:
- React: 19.x
- Firebase CLI: 11.x
- Hosting URL: https://netflix-gpt-f42a3.web.app/
What else should I check to resolve this issue?
1 Answer 1
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.
2 Comments
Explore related questions
See similar questions with these tags.
http://netflix-gpt-47dd8.web.app/and the website opens up for me but you have mentionedhttps://netflixgpt-fadcf.web.app/in your question. Have you rechecked your project ID and hosting URL in Firebase console?vite.config.ts."public": "dist",to"public": "public",, then remove the"rewrites", then add a dummyindex.htmlonpublicfolder, 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