TypeError resolver is not a function at apiauthsession endpoint

Im trying to configure Google Credentials with the Google API to have the login working. Ive put the URI redirect to http://localhost:3001/api/auth/callback/google (im using port 3001) On my Signup button i have
import { signIn } from "next-auth/react";

<button
onClick={() =>
signIn("google", {
callbackUrl: "http://localhost:3002",
})
}
import { signIn } from "next-auth/react";

<button
onClick={() =>
signIn("google", {
callbackUrl: "http://localhost:3002",
})
}
on the nextAuth file:
export const authOptions: NextAuthOptions = {
providers: [
DiscordProvider({
clientId: env.DISCORD_CLIENT_ID,
clientSecret: env.DISCORD_CLIENT_SECRET,
}),
GoogleProvider({
clientId: env.GOOGLE_CLIENT_ID,
clientSecret: env.GOOGLE_CLIENT_SECRET,
}),
]
};
export const authOptions: NextAuthOptions = {
providers: [
DiscordProvider({
clientId: env.DISCORD_CLIENT_ID,
clientSecret: env.DISCORD_CLIENT_SECRET,
}),
GoogleProvider({
clientId: env.GOOGLE_CLIENT_ID,
clientSecret: env.GOOGLE_CLIENT_SECRET,
}),
]
};
Clicking the button tho will give me a
​ GET http://localhost:3001/api/auth/error 500 (Internal Server Error)
Server Error
TypeError: resolver is not a function

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
Object.apiResolver
file:///Users/fernandocorreia/Documents/fitnessapp/fitness-app/node_modules/next/dist/server/api-utils/node.js (367:15)
​ GET http://localhost:3001/api/auth/error 500 (Internal Server Error)
Server Error
TypeError: resolver is not a function

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
Object.apiResolver
file:///Users/fernandocorreia/Documents/fitnessapp/fitness-app/node_modules/next/dist/server/api-utils/node.js (367:15)
Kinda learning how this stack works and a bit blind on this one, if anyone has any tip would be greatly appreciated. https://github.com/FACorreiaa/FitME If anyone has 5mins to spare, im sure more experienced people with this stack could see what im doing wrong. tyvm
GitHub
GitHub - FACorreiaa/FitME: Fullstack Typescript Fitness App
Fullstack Typescript Fitness App. Contribute to FACorreiaa/FitME development by creating an account on GitHub.
5 Replies
rocawear
rocawear2y ago
What you have on your callback url on their site?
rocawear
rocawear2y ago
Create T3 App
First Steps 🚀 Create T3 App
The best way to start a full-stack, typesafe Next.js app.
Knox
KnoxOP2y ago
Sorry for the language of my browser. Its the accepted javacript origins and redirected URIs. I put 3 because there is another app that i use that sometimes uses the port 3000. So i use 3001 or 3002 as well. Tried to do the Github auth and also get same error so i would guess its something on my config ? Im really blind on this one.
Knox
KnoxOP2y ago
Knox
KnoxOP2y ago
Anyone ? Im a dumbass
export default NextAuth(authOptions);
export default NextAuth(authOptions);
This was missing in the end. But thankfully now everything works
Want results from more Discord servers?
Add your server