Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Deploy complete but website not shown

it's my first time using Firebase. I deployed my angular project with the Firebase CLI, but when i navigate to the specified domain, i only see

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!

Here's my process to deploy:

firebase login
  ✔  Success! Logged in as [...]
firebase init
  select Hosting, select project, chose 'dist' as public dir
  ✔  Firebase initialization complete!
ng build --prod
firebase deploy
  ✔  Deploy complete!

This is now over 60 minutes ago, and i can't figure out why it's not online. Is 60 minutes not enough time for firebase? Can anyone share his experience or give me a hint what could be the reason why it's not online?

Thank you in advance

like image 549
SHRX Avatar asked Aug 14 '18 13:08

SHRX


People also ask

Where does firebase JSON go?

json file is generally placed in the app/ directory (at the root of the Android Studio app module). As of version 2.2. 0 the plugin supports build type and product flavor specific JSON files.


2 Answers

I solved this by following below steps:

  1. Do firebase init step properly by giving correct inputs.

    During firebase init when it asked What do you want to use as your public directory?public

    As I have given public as a answer

    Make sure you give proper link.

  2. run firebase deploy again. It should work.

Happy coding!!

like image 94
Harish Kulkarni Avatar answered Oct 18 '22 11:10

Harish Kulkarni


Just a bit more of detail. As you are using Angular, after you build your App to production, it creates (normally) a /dist/ProjectName folder where it puts your files. NOTE: if you want to change this, please refer to the option --outputPath on https://angular.io/cli/build

Sometimes (as newbies) we miss the right folder when asked on the firebase.init command...

No worries, it writes those settings at firebase.json, just open it and look for:

  "hosting": {
    "public": "dist/ProjectName",

Now change it to the desired path and there you go ;) Now you can repeat the firebase.deploy and it should all work.

Hope it helps

No it doesn't help because people don't use visual studio code, they use android studio like it was intended. There are no ng commands and there is certainly no dist

like image 2
Ramon Araujo Avatar answered Oct 18 '22 10:10

Ramon Araujo