"Try signing in with a different account: - Google and Next Auth

Hello all,
Been following the Next.JS course video and cannot get past using Google with NextAuth to work. I keep getting this error:

I have double and tripled checked my values in the .env file
GOOGLE_CLIENT_ID=my client id here

I tried with and without quotes around the values
My NEXTAUTH_URL is set to

I have also double checked my route.ts file which is in the api/auth.[…nextauth] folder
import NextAuth from “next-auth”;
import GoogleProvider from “next-auth/providers/google”;

const handler = NextAuth({
providers: [
clientId: process.env.GOOGLE_CLIENT_ID!,
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,

export { handler as GET, handler as POST };

I even tried creating the app with another google user I have and that also did not work…

There are no dev tools console errors, but when I try to compile manually, I am seeing this error and not sure if it is related to my current issue:

Retrying 3/3…
FetchError: request to https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap failed, reason: self-signed certificate in certificate chain
at ClientRequest. (C:\Dev\ReactApps\next-app\node_modules\next\dist\compiled\node-fetch\index.js:1:66160)
at ClientRequest.emit (node:events:519:28)
at TLSSocket.socketErrorListener (node:_http_client:492:9)
at TLSSocket.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
type: ‘system’,
Failed to compile.

After closing VS Code and restarting the app, once Iclick the “Sign in with Google” button, I get this error in the VS Code terminal window:
Errors | NextAuth.js self-signed certificate in certificate chain {
error: {
message: ‘self-signed certificate in certificate chain’,
stack: ‘Error: self-signed certificate in certificate chain\n’ +
’ at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)\n’ +
’ at TLSSocket.emit (node:events:519:28)\n’ +
’ at TLSSocket._finishInit (node:_tls_wrap:1085:8)\n’ +
’ at ssl.onhandshakedone (node:_tls_wrap:871:12)\n’ +
’ at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17)',
name: ‘Error’
providerId: ‘google’,
message: ‘self-signed certificate in certificate chain’

Please help. I have spend way too much time on this already and will never use it in production. I just want to get on with the following lessons.

Thank you,

The only way I have found so far to fix this is to add this entry into the .env file


I know this is not good for production, but works in dev to keep me moving. I hope someone can give the me the correct answer and way to fix this issue