question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Specify which file has JSON parsing error

See original GitHub issue

When I use the firebase deploy command I get this error:

Error: There was an error loading firebase.json:

Trailing comma in object at 11:9 } ^

My firebase.json file looks like this:

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

The json file doesn’t even have line 11 !

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
mbleighcommented, Aug 20, 2016

Could there be a trailing comma in your rules file?

On Sat, Aug 20, 2016, 3:21 PM abdoosk notifications@github.com wrote:

When I use the firebase deploy command I get this error:

Error: There was an error loading firebase.json:

Trailing comma in object at 11:9 } ^

My firebase.json file looks like this:

{ “database”: { “rules”: “database.rules.json” }, “hosting”: { “public”: “public” } }

The json file doesn’t even have line 11 !

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-tools/issues/209, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAD_kijDz_jd2CFiq1OmWdd9R39dSkyks5qh33igaJpZM4JpLXN .

3reactions
mbleighcommented, Aug 22, 2016

I’m going to leave this open with the changed title “Specify which file has JSON parsing error” – the CLI ought to direct you to the place in which the error actually occurred.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
JSON.parse() parses a string as JSON. This string has to be valid JSON and will throw this error if incorrect syntax was encountered....
Read more >
What Is JSON and How to Handle an “Unexpected Token” Error
Learn what JSON is and how you can deal with errors occurring when parsing JSON data, such as "Unexpected Token < in JSON...
Read more >
What is wrong with this JSON file? - Parse error - Stack Overflow
I am not sure what is causing the mistake. Everything is propely backslashed, there are commas, etc. Can you give me any advice?...
Read more >
JSON parse error should specify which file failed #347 - GitHub
Basically we need to catch the jsonlint exception and throw a new exception that includes the filename. All reactions.
Read more >
SyntaxError: JSON.parse: bad parsing Breaking Your Code ...
The JSON Parse error is a specific type of SyntaxError object. When Should You Use It? While most developers are probably intimately familiar ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found