Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
nextauth file imported EmailProvider is not being used

I am trying to use nextauth for authentication. I'm trying to import EmailProvider from nextauth/providers. when I use it in Nextauth providers object it does not refer to EmailProvider i've imported?

code:

import NextAuth from "next-auth/next";
import { EmailProvider } from "next-auth/providers";
import nodemailer from "nodemailer"
import { PrismaAdapter } from "@next-auth/prisma-adapter"
import { PrismaClient } from "@prisma/client";

const prisma = new PrismaClient()
export default NextAuth({
    providers: [
        EmailProvider({
            server: {
                host: process.env.NEXT_PUBLIC_EMAIL_SERVER_HOST,
                port: process.env.NEXT_PUBLIC_EMAIL_SERVER_PORT,
                auth: {
                    user: process.env.NEXT_PUBLIC_EMAIL_SERVER_USER,
                    pass: process.env.NEXT_PUBLIC_EMAIL_SERVER_PASSWORD,
                },
            },
            from: process.env.NEXT_PUBLIC_EMAIL_FROM,
            maxAge: 10 * 60,
        })
    ],
    adapter: PrismaAdapter(prisma)
})

error:

Module not found: Package path ./providers is not exported from package D:\nextautht\supa-vacation-start\supa-vacation-start\node_modules\next-auth (see exports field in D:\nextautht\supa-vacation-start\supa-vacation-start\node_modules\next-auth\package.json)
  1 | import NextAuth from "next-auth/next";
> 2 | import { EmailProvider } from "next-auth/providers";
  3 | import nodemailer from "nodemailer"
  4 | import { PrismaAdapter } from "@next-auth/prisma-adapter"
  5 | import { PrismaClient } from "@prisma/client";
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

EmailProvider is not being imported from next-auth/providers it works if we import it from next-auth/providers/email instead. I think this is because export in the nodemodules/nextauth/package.json exports providers in form of /providers/*.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!