Next.js Discord

Discord Forum

nextauth option adapter error.

Unanswered
Thai posted this in #help-forum
Open in Discord
Avatar
ThaiOP
Hi everyone!
I'm getting this build time error.
./node_modules/next-auth/src/core/lib/assert.ts:134:27
Type error: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Adapter'.
  No index signature with a parameter of type 'string' was found on type 'Adapter'.

my NextAuthOption is this
import { PrismaAdapter } from "@next-auth/prisma-adapter";
const adapter = PrismaAdapter(prisma);
export const authOptions: NextAuthOptions = {
  session: {
    strategy: "jwt",
    maxAge: 15 * 24 * 60 * 60,
    updateAge: 24 * 60 * 60,
  },
  adapter,
  providers: [
    CredentialsProvider({
      name: "KMP-credentials",
      credentials: {
        email: { label: "Email", type: "email" },
        password: { label: "Password", type: "password" },
      },
      async authorize(credentials) {
      ///////////////
      }
    }),
    GoogleProvider({
      clientId: process.env.GOOGLE_CLIENT_ID || "test",
      clientSecret: process.env.GOOGLE_CLIENT_SECRET || "test",
    }),
  ],
  pages: {
    signIn: "/auth/signin",
    signOut: "/auth/signout",
  },
 }

next-auth and next-auth/prisma-adapter versions are ^4.23.0 and ^1.0.7

I took a look at type file the error log mentions and I just don't see anything wrong with it.
if someone seen something like this please let me know!
P.S. I deleted some auth option section bc post was too long.

0 Replies