Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase hosting showing welcome page after deploying angular 6 app?

I want to develop the angular 6 apps, but after deploying firebase showing only welcome page.

Here are the steps I have taken to deploy.

  1. installed firebase-tools
  2. ng build --prod (in my app)
  3. firebase init
  4. Are you ready to proceed? (Y/n) y
  5. (*) Hosting: Configure and deploy Firebase Hosting sites
  6. What do you want to use as your public directory? (public) dist
  7. Configure as a single-page app (rewrite all urls to /index.html)? (y/N) y
  8. File dist/index.html already exists. Overwrite? (y/N) y
  9. Firebase initialization complete!
  10. In this step, I have deleted dist folder and run ng build --prod again
  11. angular build app in a subfolder inside dist directory hence I copied all the content from the subdirectory which contains index.html to dist/.
  12. firebase deploy
  13. firebase open hosting:site

but after doing all that I am still getting welcome page in the link.

What am I doing wrong!?

like image 678
rahul Kushwaha Avatar asked Jun 04 '19 15:06

rahul Kushwaha


People also ask

Why am I seeing 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! This is some kind of annoying think that you have to face when you deploy your application in to firebase. You can fix it easily after the firebase init , firebase.

Can we deploy angular app in firebase?

Deploy an Angular application on Firebase 10) Chose "Analytics location". Select "I accept the Google Analytics terms" and click on "Create project". 11) Go to Angular CLI and run this command. If there is any error, then run with sudo.


2 Answers

Try: 8. File dist/index.html already exists. Overwrite? (y/N) N and open link to your app in incognito mode. Seriously, I stuck for hours because this firebase index got cached in my case, so this was the reason why I could't see my app after deploy.

like image 199
Łukasz Dębiec Avatar answered Nov 15 '22 03:11

Łukasz Dębiec


Browser cache was my issue as well. As mentioned above, try in incognito or use proxysite.com (very useful website) to avoid browser cache

like image 27
Ivo Tsochev Avatar answered Nov 15 '22 05:11

Ivo Tsochev