Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase deployment error

I've deployed in the past many times before. For some reason, today I am getting this error I can't seem to fix. I've tried changing tabs out with 2 or 4 spaces. I've tried different formats, and nothing works.

Here's what it says:

Error: There was an error loading firebase.json

Trailing comma in object at 29:9
    }
    ^

Here is my firebase.json

{
    "database": {
        "rules": "database.rules.json"
    },
    "hosting": {
        "public": "public"
    }
}

How do I solve it?

PS: If you need anything else please ask.

like image 556
Adam Mikacich Avatar asked Aug 26 '16 04:08

Adam Mikacich


2 Answers

Change your firebase json file to

{
  "database": {
    "rules": "database.rules.json"
  },
  "hosting": {
    "public": "public",
    "rewrites": [
    ]
  }
}

If you are still having issues then you also have to change your database file to

{
  "rules": {
    ".read": "auth != null",
    ".write": "auth != null"
  }
}
like image 199
Chriskot Avatar answered Oct 21 '22 09:10

Chriskot


To anyone experiencing this problem, I solved mine by going to the file "database.rules.json", and removing the last comma in the line ".write": true,

{
  "rules": {
    ".read": true,
    ".write": true,
  }
}

It seems Firebase generated an invalid JSON.

like image 35
eyeezzi Avatar answered Oct 21 '22 09:10

eyeezzi