Firebase - Invalid JSON data or key values. Key values can’t contain $ # [ ] / or

后端 未结 9 2178
陌清茗
陌清茗 2020-12-31 03:34

I\'m trying to import my JSON file into my Firebase but it keeps giving me this error. I don\'t know why this JSON file isn\'t allowed to be imported into since JSONLint say

9条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-31 04:19

    Two things that might help someone else save a couple of hours of head scratching:

    1) Empty strings are valid JSON keys, they're NOT valid Firebase keys.

    2) While the web tool error message is horrible, the command-line tool actually provides useful information like, say, a line number (nice when you have a 300K+ line file)

    E.g.

    firebase --project database:set / import.json

    to overwrite everything from the root

提交回复
热议问题