Next.js Discord

Discord Forum

Missing adapter method

Unanswered
Brouillard posted this in #help-forum
Open in Discord
Avatar
this is the error I have
[next-auth][error][MISSING_ADAPTER_METHODS_ERROR] 
https://next-auth.js.org/errors#missing_adapter_methods_error Required adapter methods were missing: createVerificationToken, useVerificationToken, getUserByEmail MissingAdapterMethods [MissingAdapterMethodsError]: Required adapter methods were missing: createVerificationToken, useVerificationToken, getUserByEmail
    at assertConfig (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.24.3_next@13.5.5_nodemailer@6.9.7_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/lib/assert.js:71:20)
    at AuthHandler (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.24.3_next@13.5.5_nodemailer@6.9.7_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/index.js:90:54)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async NextAuthRouteHandler (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.24.3_next@13.5.5_nodemailer@6.9.7_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/next/index.js:50:30)
    at async NextAuth._args$ (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.24.3_next@13.5.5_nodemailer@6.9.7_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/next/index.js:85:24)
    at async /home/brouillard/Documents/PROG/rencontres_artistiques/node_modules/.pnpm/next@13.5.5_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:62499 {
  code: 'MISSING_ADAPTER_METHODS_ERROR'
}

2 Replies

Avatar
and here is my app/api/[...nextauth]/route.ts
import NextAuth from "next-auth"
import CredentialsProvider from "next-auth/providers/credentials"
import EmailProvider from "next-auth/providers/email"
import { PrismaAdapter } from "@next-auth/prisma-adapter"
import prisma from "../../../../utils/prismaClient"

const handler = NextAuth({
  adapter: PrismaAdapter(prisma),
  providers: [
    CredentialsProvider({
      name: "Credentials",
      credentials: {},
      async authorize(credentials: any): Promise<any> {
        const user = JSON.parse(credentials.user)
      },
    }),
    EmailProvider({
      server: {
        host: process.env.EMAIL_SERVER_HOST,
        port: Number(process.env.EMAIL_SERVER_PORT),
        auth: {
          user: process.env.EMAIL_SERVER_USER,
          pass: process.env.EMAIL_SERVER_PASSWORD,
        },
      },
      from: process.env.EMAIL_FROM,
    }),
  ],
})

export { handler as GET, handler as POST }
it seems that it couls be the prisma adapter thant can't handle email provider