2017-10-18 121 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社区。