smit patel
smit patel

Reputation: 125

firebase deploy error and fiebase.json empty file

I'm following this tutorial Getting Started with Firebase Hosting on the Web - Firecasts

I'm trying to host a simple index.html file in firebase but when I type firebase deploy its gives me the following error:

No targets found. Valid targets are: database,storage,functions,hosting. hosting error image

I found my firebase.json file is empty it contains only { } .

Upvotes: 10

Views: 22128

Answers (2)

Amresh
Amresh

Reputation: 816

run firebase init again.

When you are asked for - Which Firebase CLI features do you want to setup for this folder?

Press Space to select features, it will mark that feature with asterisk.

Then Enter to confirm your choices.

Make sure you select the options by pressing spacebar, then press enter.

Upvotes: 56

niranjan pb
niranjan pb

Reputation: 1153

run firebase init and if your firebase.json is empty with only {} then add

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

replace "public": "app" with "public": "public"

then run firebase deploy

Upvotes: 2

Related Questions