Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase deploy 404 can't find index.html

I'm running firebase init and it's creating firebase.json. firebase.json is in the apps root directory, pointing towards my public directory app. See here:

firebase.json

{
  "firebase": "harrison",
  "public": "app",
  "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
  ]
}

Here is where my firebase.json lives: enter image description here

Here is my public directory, app: enter image description here

When I run firebase deploy from the command line, everything seems to upload correctly. I then run firebase open or equivalently go to the deploy site, and I get a 404 saying my index.html was not found when it's CLEARLY in the specified directory.

like image 617
Himmel Avatar asked Jan 31 '15 02:01

Himmel


People also ask

Where is my Firebase JSON file?

Firebase automatically creates your firebase. json file at the root of your project directory when you run the firebase init command.

Why am I showing Firebase Hosting setup complete?

You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary! You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.


1 Answers

"rewrites": [
  {
    "source": "**",
    "destination": "/index.html"
  }

I met the same problem as yours, here is my soluation:

  1. run firebase init

  2. choose the host option

  3. rewrite all to index:yes

  4. overwrite to dist/index :no

and then firebase deploy

and then solve the problem

like image 91
li jing Avatar answered Nov 16 '22 02:11

li jing