Firebase not running index.html file

前端 未结 17 2454
遥遥无期
遥遥无期 2020-12-09 02:24

I\'m a pretty new programmer going through the Firebase tutorial. I have gone through steps 1-5 of the tutorial (https://codelabs.developers.google.com/codelabs/firebase-web

相关标签:
17条回答
  • 2020-12-09 03:17

    Firebase hosting not showing up app?

    There might be two reasons for this problem

    1st step:

    Make sure your public folder (define in your firebase.json) 'dist' containing the index.html hasn't been modified by firebase init command, if yes replace it with your original project index.html

    for reference (dist is standard but your may different)

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

    2nd step:

    Make sure to configure your base href in project's index.html

    as

    <base href="https://["YOUR FIREBASE PROJECT NAME"].firebaseapp.com/">
    

    and other bundle files as

    <script type="text/javascript" src="https://["YOUR FIREBASE PROJECT NAME"].firebaseapp.com/runtime.a66f828dca56eeb90e02.js">
    

    <script type="text/javascript" src="https://["YOUR FIREBASE PROJECT NAME"].firebaseapp.com/main.2eb2046276073df361f7.js">
    

    3rd step run command - firebase deploy

    enjoy ! ;)

    0 讨论(0)
  • 2020-12-09 03:19

    In public folder option write dist/your-folder-name. This will allow you to render your index file which is in your folder.

    0 讨论(0)
  • 2020-12-09 03:21

    I figured out my answer. The index.html file that was being posted was in the "public" file, which was created during the "firebase init" stage. I replaced that placeholder html file with the one for my app.

    0 讨论(0)
  • 2020-12-09 03:21

    For anyone else comming across this. Try launching in incognito mode - the browser was cached for me.

    https://stackoverflow.com/a/56468177/2047972

    0 讨论(0)
  • 2020-12-09 03:22

    I faced similar situation. When we run firebase init it asks couple of questions. At that time we mention the directory path from where firebase will take all files to deploy. Make sure that, directory contain index.html.

    0 讨论(0)
提交回复
热议问题