Next.js Discord

Discord Forum

Next.js Vercel Deployment Error

Answered
Alligator mississippiensis posted this in #help-forum
Open in Discord
Alligator mississippiensisOP
I am encountering with this error. How can I fix it?
Answered by Cape horse mackerel
you should remove export from export const handler
View full answer

11 Replies

Alligator mississippiensisOP
export const handler = NextAuth(authOptions);


export {handler as GET, handler as POST};
this is my code
Cape horse mackerel
and authOptions looks like?
Alligator mississippiensisOP
export const authOptions: NextAuthOptions = {
    providers: [
        GithubProvider({
            clientId: process.env.GITHUB_ID ?? "",
            clientSecret: process.env.GITHUB_SECRET ?? ""
        }),
    ],
    secret: process.env.NEXTAUTH_SECRET
}
Cape horse mackerel
you should remove export from export const handler
Answer
Cape horse mackerel
as you're exporting it as GET/POST
Alligator mississippiensisOP
i will try it again
Cape horse mackerel
Is it working?
@Cape horse mackerel Is it working?
Alligator mississippiensisOP
oh, sorry I forgot to update you. Yes thanks a million!
but this time I have another problem
Cape horse mackerel
what's the issue?
if it's not related to this one, feel free to mark post as resolved