[Trouble Shooting] 서버 에러 문제 대응 Axios Interceptor
#300
sgoldenbird
started this conversation in
Trouble Shooting
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
🐞 문제 상황 (Problem Description)
브라우저에서 CORS 에러처럼 보이는 메시지가 반복적으로 발생했고, 새로고침을 하면 가끔 요청이 성공하는 이상한 현상이 발생했다.
개발자 도구에서는 Internal Server Error (500)가 함께 출력되었고, 처음엔 클라이언트 측 요청 문제 혹은 CORS 설정 문제라고 판단했다.
💻 환경 정보 (Environment)
🔍 발생 원인 분석 (Investigation)
하지만 CORS 설정은 서버에서 이미 와일드카드(*)로 되어 있었고,
새로고침 시 요청이 간헐적으로 성공/실패를 반복한다는 점에서 클라이언트 문제보다는 서버 문제 가능성이 높다고 판단했다.
🛠 시도해본 해결 방법 (Attempts)
Access-Control-Allow-Origin: *)vite.config.js에서 proxy 설정)axios interceptor로 요청 실패 시 자동 재시도 처리✅ 최종 해결 방법 (Final Solution)
💡 알게 된 점 (Lessons Learned)
📚 래퍼런스
Beta Was this translation helpful? Give feedback.
All reactions