Next.js Discord

Discord Forum

CLIENT_FETCH_ERROR with Safari (ios and mac)

Unanswered
Himalayan posted this in #help-forum
Open in Discord
HimalayanOP
I'm trying to setup nextauth authentication with NextAuth.js, everything works well with Chrome but with safari, I'm redirected to the error auth page and in the console, I can see:

[next-auth][error][CLIENT_FETCH_ERROR] 
"
https://next-auth.js.org/errors#client_fetch_error"
"Load failed"
{error: {message: "Load failed", stack: undefined, name: "TypeError"}, url: "/api/auth/providers", message: "Load failed"}


I use ngrok, and when I see the request log I see:

GET /api/auth/providers HTTP/1.1
Host: redacted.ngrok-free.app
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-GB,en;q=0.9
Content-Type: application/json
Cookie: __Secure-next-auth.callback-url=https%3A%2F%2Fredacted.ngrok-free.app%2F; __Host-next-auth.csrf-token=e72bfe9e271100d559eb0b389b953b85049a7b468fe3c014aaae967f8a040fdd%7C2453a00044637e1b41b5f309b48b63368961e5f43ad7acbd490c57e3528c8cf8
If-None-Match: "nsh9j67fn476"
Referer: https://redacted.ngrok-free.app/auth/signin?callbackUrl=https%3A%2F%2Fredacted.ngrok-free.app%2F
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
X-Forwarded-For: my-ip
X-Forwarded-Proto: https


btw I use ngrok, and I've set up NEXTAUTH_URL. This is weird because it works on chrome, like if safari understand 304 as an error or I don't know.
Any help appreciated 🙂

0 Replies