-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 characater at line 1 column 1 of the JSON data #5874
Comments
Hi @koala819, you probably made progress on this already, but for folks who stumble across this in the future, I'll explain what needs to be corrected in your setup. If the code you provided in import NextAuth from 'next-auth'
import GoogleProvider from 'next-auth/providers/google'
export default NextAuth({
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_ID,
clientSecret: process.env.GOOGLE_SECRET
}),
]
}) In You will also want to change
|
Same thing here. |
Hi @wmcb91 thank you to answer. In fact since this error has disappeared. As you said I changed NEXT_PUBLIC_SECRET to NEXTAUTH_SECRET; then for the rest I already had the process.env and the imports. |
By deleting another api folder that was located at the same directory level as the pages directory, I was able to fix the issue. Hope that was helpful. |
For me i put the folder structure like app/api/auth/[...nextauth]/route.ts |
Environment
System:
OS: Linux 5.10 Ubuntu 20.04 LTS (Focal Fossa)
CPU: (16) x64 AMD Ryzen 7 PRO 4750U with Radeon Graphics
Memory: 23.05 GB / 24.45 GB
Container: Yes
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
Yarn: 1.22.19 - /usr/bin/yarn
npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
npmPackages:
next: 12.3.0 => 12.3.0
next-auth: ^4.17.0 => 4.17.0
react: 18.2.0 => 18.2.0
Reproduction URL
http://localhost:3000
Describe the issue
Hello there,
I'm trying to implement sign-in option in my next js app. I configure :
.env.local
[...nextauth].js
How to reproduce
I just added next-auth in my existing nextjs app.
Expected behavior
I just want to implement GoogleProvider in my nextjs app.
The text was updated successfully, but these errors were encountered: