微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Firebase JSON 导入错误意外令牌“:”

如何解决Firebase JSON 导入错误意外令牌“:”

对 firebase 进行测试导入(这里不是全职开发人员)并且对 Firebase 和 node.js 非常陌生,我正在导入以下文件,之后出现以下错误

{
    "__collections__": {
        "scores": {
            "comment": "test comment","companyId": "ec24fmJeLA93l5jWPAN0","date": 1607770800.00,"email": "bdavis@wftst.com","score": 3,"tags": [
                "Supervisor Issues","Communication Issues"
            ],"userId": "a8waViyRAJWGr2h6Gc3u","__collections__": {}
    }
}

运行导入后,我的终端出现以下错误

*JSONError: Unexpected token ":" (0x3A) in JSON at position 30 while parsing near "...ctions__\": \n\"scores\": {\n    \"comment\": \"..." in TEST_BDAVIS.json 
  1 | {
  2 | "__collections__": 
> 3 | "scores": {
    |         ^
  4 |     "comment": "test comment",5 |     "companyId": "ec24fmJeLA93l5jWPAN0",6 |     "date": 1607770800.00,JSONError: Unexpected token ":" (0x3A) in JSON at position 30 while parsing near "...ctions__\": \n\"scores\": {\n    \"comment\": \"..." in TEST_BDAVIS.json 
  1 | {
  2 | "__collections__": 
> 3 | "scores": {
    |         ^
  4 |     "comment": "test comment",at module.exports (/usr/local/lib/node_modules/node-firestore-import-export/node_modules/parse-json/index.js:29:21)
    at parse (/usr/local/lib/node_modules/node-firestore-import-export/node_modules/load-json-file/index.js:15:9)
    at Object.module.exports [as default] (/usr/local/lib/node_modules/node-firestore-import-export/node_modules/load-json-file/index.js:18:47)*

解决方法

在您提供的 JSON 中,似乎缺少 }。您的整个文件以及第一个 __collections__scores 部分应该在哪里结束?这可能是导致错误的原因。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?