[Next-auth] ClientFetchError: There was a problem with the server configuration.

나라·2023년 12월 11일
0

Trouble Shooting

목록 보기
4/14
post-thumbnail

개요

  • .env, .env.local 파일이 gitignore되지 않아 (분명 .gitignore파일에 포함되어 있는데도😒)
    소셜 로그인 구현을 위해 발급 받은 카카오 및 네이버 API KEY가 그대로 깃헙에 올라갔다

  • 이런 경고 메일이 와서 사태 인지

  • 참고velog 보면서 수습하긴 했지만 갑자기 그 뒤부터 npm run dev 하면 오류가 뜨기 시작

오류 내용

// error message

ClientFetchError: There was a problem with the server configuration. Check the server logs for more information. .Read more at https://errors.authjs.dev#autherror
    at fetchData (client.js:50:22)
    at async getSession (react.js:102:21)
    at async __NEXTAUTH._getSession (react.js:252:43)
    ...

문제 해결

NEXTAUTH_SECRET=

  • 앞선 헤프닝으로 .env, .env.local 파일을 지지고 볶는 과정에서 해당 키 값이 빠져있는 상태였고 거기서 파생되는 오류였다
  • NEXTAUTH_SECRET 값을 다시 .env 파일에 추가하니 정상 작동 🙌🏻
profile
FE Dev🔥🚀

0개의 댓글