Deploying on firebase gives welcome screen
I got this message after deploying app on firebase .

I want to host my app on firebase.
I followed these steps.
- npm run build and it created build folder
- firebase init , select hosting ,
- What do you want to use as your public directory? build
- Configure as a single-page app (rewrite all urls to /index.html)? Yes
- File build/index.html already exists. Overwrite? No
- and then finally firebase deploy after sometime I see files uploaded successfully and in firebase hosting dashboard it shows files uploaded something like 727 . but app looks something like a welcome message "Welcome Firebase Hosting Setup Complete . You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary!"
however, if I create a react app using create-react-app , and follow same steps , its working fine at same url and host. it display app at once without a problem.
my firebase.json
{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
HI,
I fixed mine by overwriting the index.html again.
check your index.html inside build folder. It must be the same the one outside the build folder.
Hope it works.
@amitbravo did you get your answer? Because I am facing the same issue. @joshua1525 I tried your suggestion but it did not work for me
My solution is just waiting a bit. Then, if it still not working. let try:
Solution 1: check your index.html inside "build" folder and index.html in your own project. They should be the same, if not, copy code index.html outside "build" folder and paste into index.html inside "build" folder.
solution 2 : delete your .firebase folder. and init it again. => firebase init ? What do you want to use as your public directory? build < == NOTE: "build" is my directory ? Configure as a single-page app (rewrite all urls to /index.html)? No <== select NO ? File build/404.html already exists. Overwrite? No <== select NO ? File build/index.html already exists. Overwrite? No <== select NO
After doing these things, I also get that notification of "Welcome Firebase Setting Host Complete" , and I just wait for a while. then reload the website.
if you one folder name todo then in that you have public folder in that folder all main project files you have to give after that you then npm install -g firebase-tools in cmd firebase login cd dirto your project folder firebase init then select all N no ok read that carefully then firebase deploy this help for me and in your public original folder firebase creates another folder then you delete that files and then delpoy ok this work for me if does not work then mail me here are my app link https://todo-37acc.firebaseapp.com/ after my comment i hope issue is closed This thing is working for me please go through from it
@amitbravo did you get your answer? Because I am facing the same issue. @joshua1525 I tried your suggestion but it did not work for me
i have answer please see it it is going to help you i commented on that
HI,
I fixed mine by overwriting the index.html again.
check your index.html inside build folder. It must be the same the one outside the build folder.
Hope it works.
hello what do u mean by outside folder , does we need to cut the index.html inside from src folder to outside , I already did that and it doesnt work for me or I am doing it wrong can somebody help me
@Azkuu for that you to delete that outside file in you website folder index.html file then Firebase deploy this works for me hope this issue is clear as I mentioned earlier also you go through that jude .thank you
@amitbravo You want to change your firebase.json config slightly. You currently have the public directory set to build but if you look in there, the index.html is the file you're seeing with the "Firebase Hosting Complete" message. When you build your app, it is actually being put into build/your-app-name so you'll need to change the line in firebase.json from:
"public": "build",
to:
"public": "build/your-app-name",
no it's fine I find out that when I do ng prod the html will be in dist/my-app-name app so then my firebase init will be dist/my-app-name
On Sat, Oct 5, 2019 at 3:55 AM Mike Over [email protected] wrote:
@amitbravo https://github.com/amitbravo You want to change your firebase.json config slightly. You currently have the public directory set to build but if you look in there, the index.html is the file you're seeing with the "Firebase Hosting Complete" message. When you build your app, it is actually being put into build/your-app-name so you'll need to change the line in firebase.json from:
"public": "build",
to:
"public": "build/your-app-name",
โ You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/coreui/coreui-react/issues/55?email_source=notifications&email_token=AJ6R6O4GOGFHIEWL3FDX6V3QM6NULA5CNFSM4GRQZAPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAMXIYQ#issuecomment-538539106, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ6R6OYQ6GN5NUWKHWEK6JLQM6NULANCNFSM4GRQZAPA .
thank you, I had the same problem now it's fine
@amitbravo You want to change your
firebase.jsonconfig slightly. You currently have thepublicdirectory set tobuildbut if you look in there, theindex.htmlis the file you're seeing with the "Firebase Hosting Complete" message. When you build your app, it is actually being put intobuild/your-app-nameso you'll need to change the line infirebase.jsonfrom:"public": "build",to:
"public": "build/your-app-name",
When I switch it to "build/app-name" I get the error message:
Error: Specified public directory 'build/app-name' does not exist, can't deploy hosting to site app-name
My app name and firebase name are slightly different. Would that matter?
@amitbravo You want to change your
firebase.jsonconfig slightly. You currently have thepublicdirectory set tobuildbut if you look in there, theindex.htmlis the file you're seeing with the "Firebase Hosting Complete" message. When you build your app, it is actually being put intobuild/your-app-nameso you'll need to change the line infirebase.jsonfrom:"public": "build",to:
"public": "build/your-app-name",
It helped me.
-
you should build the project using
ng build --prod -
login firebase using
firebase login -
Type
firebase init hosting -
To this question => (What do you want to use as your public directory? ) you should add the path of dist folder like this => dist/abcd

-
Don't give any yes commands and type no.
-
finally you can deploy the app.. if any welcome screen is showing your browser refresh it.
- you should build the project using
ng build --prod- login firebase using
firebase login- Type
firebase init hosting- To this question => (What do you want to use as your public directory? ) you should add the path of dist folder like this => dist/abcd
- Don't give any yes commands and type no.
- finally you can deploy the app.. if any welcome screen is showing your browser refresh it.
After this you should verify that you don't have any dist/index.html
I solved this issue by going to /login page after deploying my application. i.e. firebaseUrlForYourApp/login , I went to /login because I have created a route for this in my angular application. you can also try to redeploy, I also changed the target folder while deploying, from dist to dist/<project_name> , also if it didn't work even after that then try to rebuild it and re-deploy. then try first step by going to /login.
Hi,
i made the mistake at your point 3. to select my dist folder. The index.html file there, was exactly the welcome site. So at point 3 i choose dist/
I guess the welcome page is coming from cache.
Delete .firebase Folder and all related firebase.

then
- Execute firebase init update firebase.json "public": "build/your-app-name"
- ng build --prod
- firebase deploy
I got the same issue, this is how I solved it.
Below is how I deployed my app after executing firebase init command. You may need to clean browser cache, or open page on incognito mode. Before firebase deploy command, check value of public key in firebase.json file. It might change the value.

I also encountered the same problem, broke my head with it for almost a day but actually it was a pretty simple fix.
For example: When prompted to select the build directory, I just specified the outer folder containing the build and other code. So it might look something like this:
What do you want to use as your public directory? my-app/build
So instead of doing firebase init from the my-app folder and targeting build. Just go one level above, target the folder that contains the build folder.
Hope this helps to other people having the same issue.

Steps for successful deployment
- before executing
firebase initcommand you to build your react app by usingnpm build or yarn build - And after
firebase initthen rewrite public as build folder then yes for single page app and No for rewriting all index.html files and before all of this you need to have app created in firebase console and after selecting those all things your going to execute all this above things(commands) and after just typefirebase deploythen your good to Go๐ค๐ See my app here Myapp๐๐งโ๐