Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My website is not showing after deploy in firebase how to solve this

I have complete all process

  1. Firebase Login
  2. Firebase init
  3. Firebase deploy

now finally i got a link https://testing-37553.firebaseapp.com/ but my website not showing so what should i have to do. enter image description here

like image 833
Sourabh Dubey Avatar asked Aug 28 '18 03:08

Sourabh Dubey


3 Answers

What you are seeing is the default index.html page that is created by the CLI when you create a new project.

You should adapt this index.html page as you whish (i.e. by modifying the HTML/CSS/JS code of this page, in your local project directory) and re-deploy the project with

firebase deploy

or

firebase deploy --only hosting
like image 169
Renaud Tarnec Avatar answered Jan 03 '23 23:01

Renaud Tarnec


Go to your firebase.json file and make sure that the 'public' key under "hosting" is set to "build" like below:

"hosting": {
    "public": "build"
}

It was likely set to "public" by default when you ran firebase init. In which case it would look like this:

"hosting": {
    "public": "public"
}

The problem with the default is that React places all your static assets in the 'build' directory when you run npm run build, so that is where you want to point firebase to.

like image 32
Paul Davis Avatar answered Jan 03 '23 22:01

Paul Davis


I faced the similar issue, my application was on react built using create react app. I was trying to deploy via firebase but getting the default page of firebase then i figured out that I havent build my application so firebase was not able to find my application html file and hence it was trying to deploy the default one.

I solved it by running yarn build, then when I do firebase init selected "hosting" option . After this step while selecting folder to deploy rather public I selected "build" and this solved my problem and my application got hosted. Hope this helps!!

like image 31
Kavitha Vikas Avatar answered Jan 03 '23 23:01

Kavitha Vikas