Next.js 13.4.19 nextauth Build error.
Unanswered
Long-billed Curlew posted this in #help-forum
Long-billed CurlewOP
app/api/auth/[...nextauth].ts
import NextAuth, { NextAuthOptions } from 'next-auth';
import GithubProvider from 'next-auth/providers/github';
export const authOptions: NextAuthOptions = {
providers: [
GithubProvider({
clientId: process.env.GITHUB_ID as string,
clientSecret: process.env.GITHUB_SECRET as string,
}),
],
};
const handler = NextAuth(authOptions);
export { handler as GET, handler as POST };I'm trying to run
npm run build for building my next application (V13.4.19), but i'm getting an error as mentioned in the snapshot.Error:
Type error: Type 'OmitWithTag<typeof import("I:/k8pai.dev/app/api/auth/[...nextauth]/route"), "GET" | "POST" | "HEAD" | "OPTIONS" | "PUT" | "DELETE" | "PATCH" | "config" | "generateStaticParams" | "revalidate" | ... 5 more ... | "maxDuration", "">' does not satisfy the constraint '{ [x: string]: never; }'.
Property 'authOptions' is incompatible with index signature.
Type '{ providers: OAuthConfig<GithubProfile>[]; }' is not assignable to type 'never'.