❓ local에서 사용할때는 새로고침을해도 페이지가 유지가 되었는데
실서버에서는 새로고침을하면 페이지가 /로 이동하는 오류가 생겼다.
router.push() router.reload() window.location.href window.location.reload window.history.go(0) 다 사용해봤지만 소용이 없었다.
// firebase.json
{
"hosting": {
"public": "out",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
❗ firebase.json파일의 rewrites설정이 문제였다.
rewrites를 지워주고 cleanUrls를 추가해주었다.
// firebase.json
{
"hosting": {
"public": "out",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"cleanUrls" : true
}
}