【问题标题】:React and Firebase Deploy: Giving blank pageReact 和 Firebase Deploy:给出空白页
【发布时间】:2019-02-12 16:55:08
【问题描述】:

我正在尝试将我的应用部署到 Firebase。这是一个单页应用程序。我之前部署时取得了成功,在开发开始时查看 Redux 和 Router 是否正常工作(它们是)。但是现在在我部署的最后阶段,我得到了空白页面,我不知道为什么。我知道它与它有关,假设它是一个 javascript 文件,当它看到

它给了我错误

Uncaught SyntaxError: Unexpected token <    
Uncaught SyntaxError: Unexpected token <
Manifest: Line: 1, column: 1, Unexpected token.

firebase init的时候我选择了

 What do you want to use as your public directory? build 
 ? Configure as a single-page app (rewrite all urls to /index.html)? Yes 
 ? File build/index.html already exists. Overwrite? No

我的firebase.json看起来像这样

{
  "database": {
    "rules": "database.rules.json"
  },
  "hosting": {
    "public": "build",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
    ]
  }
}

My package.json

【问题讨论】:

  • 你好 Zhast,我也面临类似的问题,你能写出它是如何解决你的问题的吗?

标签: reactjs firebase deployment


【解决方案1】:

我遇到了类似的问题。摆脱语法错误。我必须在每个文件的每次导入后加上分号...不过我还没有找到修复清单错误的正确方法。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-10-20
    • 2022-01-16
    • 1970-01-01
    • 1970-01-01
    • 2020-11-23
    • 2018-10-12
    • 2020-12-25
    • 2019-02-26
    相关资源
    最近更新 更多