【问题标题】:Unexpected error when deploying webapp on firebase在 Firebase 上部署 webapp 时出现意外错误
【发布时间】:2019-08-23 10:15:59
【问题描述】:

我尝试在 Firebase 上托管我的静态网站。我浏览了 Firebase 官方网站上的教程。

我尝试部署它,更改了 firebase.json 文件,但没有任何帮助

"hosting": {
  "public": "public", 
  "ignore": [
    "firebase.json",
  ]
}

这是我的 firebase.json 文件

这是我运行 firebase deploy 时的错误消息:

mp@linux:~/Documents/Website/Codebytessoftware$ firebase deploy

Error: There was an error loading firebase.json:

Unexpected token ':' at 1:10
"hosting": {
         ^
File: "/home/mp/Documents/Website/Codebytessoftware/firebase.json"

Having trouble? Try firebase deploy --help

【问题讨论】:

    标签: json firebase web firebase-hosting


    【解决方案1】:

    您的 firebase.json 不是有效的 json 文件。试试这个:

    {
      "hosting": {
        "public": "public", 
        "ignore": [
          "firebase.json"
        ]
      }
    }
    

    您可以在here中检查您的json文件是否为有效json

    【讨论】:

    • 我的错,我搞砸了编辑器,错过了“托管”的右括号。我编辑了答案,现在试试。
    • 谢谢 :) 在您的帮助下,我找到了解决方案。你忘了第二个}
    猜你喜欢
    • 2019-09-30
    • 2019-09-11
    • 1970-01-01
    • 2020-07-06
    • 2023-03-04
    • 1970-01-01
    • 2022-01-09
    • 1970-01-01
    • 2017-07-17
    相关资源
    最近更新 更多