hsleedevelop
hsleedevelop
hsleedevelop
  • 분류 전체보기 (25)
    • Develop (25)
      • CS (1)
      • iOS (7)
      • Swift (14)
      • SwiftUI (0)
      • Flutter (1)
      • React (1)

최근 글

인기 글

태그

  • architecturel
  • Simulator
  • XIB Inspectable
  • Jump to definition
  • enum 연동하는 방법
  • Xcode 정의
  • GoRoute Nav
  • Xcode 빌드
  • Link
  • GoRouter
  • 시뮬레이터
  • builtInWideAngleCamera
  • Xcode 정의로 이동하지 않고 우측 에디터에서 보는 방법
  • xcode 꿀팁
  • iOS QRCode
  • next-auth
  • CLIENT_FETCH_ERROR
  • xcode 팁
  • Xcode 14 빌드 속도 올리는 방법
  • GoRoute 분기
  • GoRoute Modal
  • Swift
  • Xcode
  • excldue
  • addPostFrameCallback
  • Xcode 베젤
  • html
  • Xcode Definition
  • GoRoute Popup
  • 스위프트

최근 댓글

전체 방문자
오늘
어제

티스토리

hELLO · Designed By 정상우.
hsleedevelop

hsleedevelop

[React] next-auth > CLIENT_FETCH_ERROR 해결 방법
Develop/React

[React] next-auth > CLIENT_FETCH_ERROR 해결 방법

2024. 1. 8. 00:16
반응형

React + Next.js + NextAuth.js 환경에서 Sign-In 요청 후 404 페이지로 이동하는 에러 발생 시 해결방법입니다.

아마 아래와 같은 디버그 에러를 만나게 될텐데요, 

이런 경우는 [...nextauth].ts의 경로를 확실히 수정해야 합니다.

[next-auth][error][CLIENT_FETCH_ERROR]  https://next-auth.js.org/errors#client_fetch_error Unexpected token '<', "<!DOCTYPE "... is not valid JSON {error: {…}, url: '/api/auth/providers', message: 'Unexpected token '<', "<!DOCTYPE "... is not valid JSON'}

 

/src/pages/api/auth/[...nextauth].tsx

참고: https://authjs.dev/guides/basics/initialization

 

 

개발환경

"next": "14.0.4",
"next-auth": "^4.24.5",

 

 

반응형
    hsleedevelop
    hsleedevelop
    iOS, Swift js, node js, react c, c++, .net ruby, sql

    티스토리툴바