Firebase not running index.html file

前端 未结 17 2460
遥遥无期
遥遥无期 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:14

    In my case firebase was using the wrong directory, also see here: firebase CLI didn't recognize the current project directory for 'firebase init'. While I was expecting firebase to put all created files into my project directory it was totally disconnected and put all files into my /Users/MyUserName directoy and deploying the wrong index.html from there.

    This is how to fix it (no reinstall of firebase needed as suggested in the linked post):

    • delete all created firebase files from /Users/MyUserName directoy (.firebaserc, firebase.json, index.html and dist-folder)
    • run firebase init on project directoy
    • use dist/projectname as public directory
    • Configure as a single-page app "Yes"
    • do not overwrite index.html (if you do, make sure to "ng build" again before deploying)
    • firebase deploy

    By the way, for everyone who is using Angular 7, this tutorial about deploying an angular 7 app to firebase hosting was really helpfull to me.

提交回复
热议问题