Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 当我重新加载firebase上的react应用程序时,获取404页面未找到错误_Reactjs_Firebase_Firebase Hosting - Fatal编程技术网

Reactjs 当我重新加载firebase上的react应用程序时,获取404页面未找到错误

Reactjs 当我重新加载firebase上的react应用程序时,获取404页面未找到错误,reactjs,firebase,firebase-hosting,Reactjs,Firebase,Firebase Hosting,我已经在firebase上部署了我的react应用程序,当我重新加载页面时,它会显示下面的页面。 Firebase.json { "hosting": { "public": "build", "ignore": ["firebase.json", "**/.*", "**/node_modules/**"] } } 没有一个单页应用程序添加以下重写规则: "hosting": { "public": "build", "ignore": [

我已经在firebase上部署了我的react应用程序,当我重新加载页面时,它会显示下面的页面。

Firebase.json

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

没有一个单页应用程序

添加以下
重写规则:

"hosting": {
    "public": "build",
    "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
    ],
    "rewrites": [
        {
            "source": "**",
            "destination": "/index.html"
        }
    ]
}
这将确保Firebase将为您的React应用程序提供任何请求的路由