-
[vercel] vercel.json 설정error 2023. 11. 29. 16:26
vercel로 프로젝트를 배포 후 두 가지 이슈를 만났다.
1. 새로고침 시 404 에러
2. /api 경로를 받아오지 못함
// vercel.json { "rewrites": [ { "source": "/api/:path*", "destination": "https://port-0-on-hospital-2023-backend-3yl7k2bloql05nw.sel5.cloudtype.app/:path*" }, { "source": "/(.*)", "destination": "/" } ] }두 가지 이슈 모두 인덱스 경로를 설정하여 해결하였다. 새로고침 시 알아서 해당 위치의 라우트로 이동을 시켜준다.
'error' 카테고리의 다른 글
[react-slick] currentSlide, slideCount error (0) 2024.07.16 [vercel 빌드 오류] Cannot find module '파일 경로' or its corresponding type declarations. (0) 2024.02.21 error : Content type 'application/octet-stream' not supported (0) 2023.10.31 [error] CORS error 해결 방법 (0) 2023.08.17 [React] 'children' is missing in props validation (0) 2023.07.31