Next.js Discord

Discord Forum

nodemailer ⨯ Error: The edge runtime does not support Node.js 'stream' module.

Unanswered
He-eman posted this in #help-forum
Open in Discord
Avatar
import { PrismaAdapter } from "@auth/prisma-adapter"
import NextAuth from "next-auth"
import Google from "next-auth/providers/google"
import prisma from "./lib/prisma"
import Nodemailer from "next-auth/providers/nodemailer"


export const { handlers, signIn, signOut, auth } = NextAuth({
    adapter: PrismaAdapter(prisma),
    providers: [
        Nodemailer({
            server: {
              host: process.env.EMAIL_SERVER_HOST,
              port: 587,
              auth: {
                user: process.env.EMAIL_SERVER_USER,
                pass: process.env.EMAIL_SERVER_PASSWORD,
              },
            },
            from: "jaden.nolan@ethereal.email",
          }),
        Google
    ],
})

1 Reply

Avatar
@He-eman js import { PrismaAdapter } from "@auth/prisma-adapter" import NextAuth from "next-auth" import Google from "next-auth/providers/google" import prisma from "./lib/prisma" import Nodemailer from "next-auth/providers/nodemailer" export const { handlers, signIn, signOut, auth } = NextAuth({ adapter: PrismaAdapter(prisma), providers: [ Nodemailer({ server: { host: process.env.EMAIL_SERVER_HOST, port: 587, auth: { user: process.env.EMAIL_SERVER_USER, pass: process.env.EMAIL_SERVER_PASSWORD, }, }, from: "jaden.nolan@ethereal.email", }), Google ], })
Avatar
⨯ Error: The edge runtime does not support Node.js 'stream' module.
Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime
at <unknown> (webpack-internal:///(middleware)/./node_modules/next/dist/esm/server/web/globals.js:34)
at Object.get (webpack-internal:///(middleware)/./node_modules/next/dist/esm/server/web/globals.js:34:19)
at eval (webpack-internal:///(middleware)/./node_modules/nodemailer/lib/base64/index.js:57:23)
at (middleware)/./node_modules/nodemailer/lib/base64/index.js (file://C:\Users\web\Desktop\3dduck New\3dduck\build\server\middleware.js:1121:1)
at webpack_require (file://C:\Users\web\Desktop\3dduck New\3dduck\build\server\edge-runtime-webpack.js:37:33)
at fn (file://C:\Users\web\Desktop\3dduck New\3dduck\build\server\edge-runtime-webpack.js:288:21)
at eval (webpack-internal:///(middleware)/./node_modules/nodemailer/lib/mime-funcs/index.js:6:16)
at (middleware)/./node_modules/nodemailer/lib/mime-funcs/index.js (file://C:\Users\web\Desktop\3dduck New\3dduck\build\server\middleware.js:1242:1)
at webpack_require (file://C:\Users\web\Desktop\3dduck New\3dduck\build\server\edge-runtime-webpack.js:37:33)
at fn (file://C:\Users\web\Desktop\3dduck New\3dduck\build\server\edge-runtime-webpack.js:288:21)
at eval (webpack-internal:///(middleware)/./node_modules/nodemailer/lib/mime-node/index.js:12:19)