React.js(SPA)で構築したサイトをFirebase Hostingを用いてデプロイすると、
以下のように、404 Page Not Found
と表示された。

firebase.jsonでのHostingの設定に問題があったらしい。
変更前
firebase.json
{
"storage": {
"rules": "storage.rules"
},
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
}
変更後
firebase.json
{
"storage": {
"rules": "storage.rules"
},
"hosting": {
"rewrites": [ {
"source": "**",
"destination": "/index.html"
} ],
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
}
これを追加した。
"rewrites": [ {
"source": "**",
"destination": "/index.html"
} ],
参照: 公式ドキュメント