Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[next-auth][error][CLIENT_FETCH_ERROR] Unexpected token '<', "<!DOCTYPE "... is not valid JSON #5861

Closed
mrseankumar25 opened this issue Nov 20, 2022 · 12 comments
Labels
incomplete Insufficient reproduction. Without more info, we won't take further actions/provide help. providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@mrseankumar25
Copy link

mrseankumar25 commented Nov 20, 2022

Provider type

Credentials

Environment

env:
NEXTAUTH_SECRET="SECRET"
NEXTAUTH_URL_INTERNAL=http://localhost:8888
NEXTAUTH_URL=http://localhost:8888/api/auth

System:
OS: Windows 10 10.0.22621
CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
Memory: 5.77 GB / 15.77 GB
Binaries:
Node: 18.8.0 - \nodejs\node.EXE
npm: 8.18.0 - \nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22621.819.0), Chromium (107.0.1418.35)
Internet Explorer: 11.0.22621.1
npmPackages:
next: ^13.0.4 => 13.0.4
next-auth: ^4.16.4 => 4.16.4
react: 18.2.0 => 18.2.0

image
image

Reproduction URL

http://localhost:8888/

Describe the issue

Hello there,

I'm trying to implement sign-in option in my next js app, however, it's not working as it should be. Whenever I tried to signin it give "there is a problem with the server configuration. check the server logs for more information." error I have attached screenshots of errors.

How to reproduce

I just added next-auth in my existing nextjs app.

Expected behavior

I just want to implement CredentialsProvider in my nextjs app.

@mrseankumar25 mrseankumar25 added providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Nov 20, 2022
@balazsorban44 balazsorban44 added the incomplete Insufficient reproduction. Without more info, we won't take further actions/provide help. label Nov 28, 2022
@balazsorban44
Copy link
Member

balazsorban44 commented Nov 28, 2022

http://localhost:8888/ is not a reproduction URL. please link to your source code. Server logs is not the same as the browser console. Check the logs in your terminal, it should explain the issue. 👍

@aledovskikh
Copy link

@mrseankumar25 Did you fix this error?

@mrseankumar25
Copy link
Author

http://localhost:8888/ is not a reproduction URL. please link to your source code. Server logs are not the same as the browser console. Check the logs in your terminal, it should explain the issue. 👍

I am trying to run it on "netlify dev", however, when I run it with npm run dev and cleared the cookies it's working fine, but I want to run it with "ntl dev" or "netlify dev"

@mrseankumar25
Copy link
Author

@mrseankumar25 Did you fix this error?

I tried it with "npm run dev" and cleaned cookies then it's working fine.

@hanibat8
Copy link

I am getting the same error. Have been trying to fix for a long time and it is not working.

@Mo-Aziz
Copy link

Mo-Aziz commented Aug 7, 2023

I have the same error as well and i have been trying all solutions for almost a day now and still unable to fetch any data from google provider

@Shahidxyt
Copy link

same error didn't found any solution for google provider

@Shahidxyt
Copy link

I have the same error as well and i have been trying all solutions for almost a day now and still unable to fetch any data from google provider

you found any solution bro?

@Mo-Aziz
Copy link

Mo-Aziz commented Aug 7, 2023

@Shahidxyt No, but i am still looking for any solutions as i can not move forward with the project without the google provider data. I hope if anyone finds a solution for the same bug, let us know.

@Shahidxyt
Copy link

@Shahidxyt No, but i am still looking for any solutions as i can not move forward with the project without the google provider data. I hope if anyone finds a solution for the same bug, let us know.

found the solution
first remove all the dependencies
npm uninstall next-auth
and then install this version it works for me
npm i next-auth@4.22.1

@prashantskywave
Copy link

prashantskywave commented Nov 21, 2023

How we can use next-auth in Next 14 ?

@hmttelange
Copy link

23-49aaaa699609f25a.js:1 [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/session', message: Unexpected token '<', "<!DOCTYPE "... is not valid JSON}
client
:
true
error
:
{message: Unexpected token '<', "<!DOCTYPE "... is not valid JSON, stack: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON, name: 'SyntaxError'}
message
:
"Unexpected token '<', "<!DOCTYPE "... is not valid JSON"
url
:
"/api/auth/session"
[[Prototype]]
:
Object
541-6ab3e0ed64b8ef1e.js:1
POST https://timesheet-v1.vercel.app/api/auth/_log 405

I am also getting this issue on production env (working in local environment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete Insufficient reproduction. Without more info, we won't take further actions/provide help. providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

8 participants