Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

firebase deploy: Error: path-to-file/firestore.indexes.json does not exist

Tags:

firebase

I added the functions folder for firebase cloud functions. But now I can not deploy my Angular project. When I deploy only the function with firebase deploy --only functions it works fine but when I try to deploy my project by running firebase deploy, I get this error:


Error: desktop/projects/my-angular-project/firestore.indexes.json does not exist

my firebase.json file :

{
  "hosting": {
    "public": "public",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**",
      "**/functions/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  },
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  },
  "functions": {
    "predeploy": [
      "npm --prefix \"$RESOURCE_DIR\" run lint",
      "npm --prefix \"$RESOURCE_DIR\" run build"
    ]
  }
}

How do I fix this?

like image 581
Peyman Kheiri Avatar asked Sep 12 '25 11:09

Peyman Kheiri


1 Answers

Your firebase.json files has an instruction to deploy security rules and predefined indexes to Firestore here:

  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  },

If you don't want either of these to happen, remove that line from the firebase.json.

like image 165
Frank van Puffelen Avatar answered Sep 15 '25 09:09

Frank van Puffelen