2017-10-18 118 views
0

firebase.json:無法與火力CLI部署網站

{ 
"hosting": { 
     "rewrites": [ 
      { 
        "source": "**", 
        "destination": "/index.html" 
      } 
    ], 
    "headers": [ { 
      "source" : "**/*[email protected](otf|woff|woff2|eot)", 
      "headers" : [ { 
        "key" : "Access-Control-Allow-Origin", 
        "value" : "*" 
    } ] 
    }, { 
      "source" : "**/*[email protected](css|js|png)", 
      "headers" : [ { 
      "key" : "Cache-Control", 
      "value" : "max-age=14400" 
      } ] 
    } ] 
 } 
} 

我無法部署火力地堡靜態網站與firebase deploy命令託管。我得到的錯誤是:

Error: There was an error loading firebase.json: 

Unexpected token ' ' at 3:1 
     "rewrites": [ 
^ 

究竟是什麼錯誤?

+0

根據https://jsonlint.com/它是有效的JSON。這個錯誤讓我覺得你的文件中第3行的開頭有一個不可見的字符。 –

回答

0

我試着刪除所有的空格,標籤&然後嘗試firebase deploy,這一次它被成功地部署了。 仍然不知道是什麼導致了這個錯誤。無論如何,感謝SO社區。