Search code examples
firebasefirebase-hosting

After hosting the website on firebase I am not able to view content


I have followed the firebase guidelines to host the website on firebase hosting, but the content of the website is not visible . I am seeing this on my screen as shared in the pictureenter image description here

what should i do about? please guide


Solution

  • Ensure that you have setup your website in the correct folder as Firebase uses folders to contain data for specific services, public for hosting and functions for cloud functions. You can find out what folder this is by opening the firebase.jsonfile at the root of your project You should find something similar if you usedfirebase init` correctly

      "hosting": {
        "public": "public",
    

    Once you run the command firebase deploy or firebase deploy --only hosting everything inside this folder is uploaded to your hosting website. Make sure you also check both URLs provided by Firebase as the web.app URL tends to take longer to update and deploy.

    • <project-id>.firebaseapp.com

    Beyond these fundamental tips I would also make sure that your entry point into the website is also correct, opening the hosting folder (public or otherwise) - and opening up the index.html within should yield you the same site found on *.firebaseapp.com