Reactjs 当我重新加载firebase上的react应用程序时,获取404页面未找到错误
我已经在firebase上部署了我的react应用程序,当我重新加载页面时,它会显示下面的页面。 Firebase.jsonReactjs 当我重新加载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": [
{
"hosting": {
"public": "build",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
}
}
没有一个单页应用程序添加以下
重写规则:
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
这将确保Firebase将为您的React应用程序提供任何请求的路由