payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
23.11k stars 1.44k forks source link

Internal error: TypeError: this.config.email is not a function #7308

Closed dominikzogg closed 1 month ago

dominikzogg commented 1 month ago

Link to reproduction

No response

Payload Version

3.0.0-beta.68

Node Version

v20.15.1

Next.js Version

14.2.5

Describe the Bug

I've update from payload@3.0.0-beta.60 to payload@3.0.0-beta.68 (cannot test those in between, cause https://github.com/payloadcms/payload/pull/7235).

Internal error: TypeError: this.config.email is not a function
    at BasePayload.init (./node_modules/.pnpm/payload@3.0.0-beta.68_@swc+core@1.7.0_@swc+helpers@0.5.5__@swc+types@0.1.12_graphql@16.9.0_typescript@5.5.3/node_modules/payload/dist/index.js:568:38)

Reproduction Steps

I use the following in my config:

import { nodemailerAdapter } from '@payloadcms/email-nodemailer';

...

 email: nodemailerAdapter({
    defaultFromAddress: process.env.MAIL_FROM_NAME_ADDRESS as string,
    defaultFromName: process.env.MAIL_FROM_NAME as string,
    transportOptions: {
      host: process.env.SMTP_HOST,
      port: process.env.SMTP_PORT ? parseInt(process.env.SMTP_PORT) : undefined,
      secure: process.env.SMTP_SECURE === 'true',
      auth: {
        user: process.env.SMTP_USERNAME,
        pass: process.env.SMTP_PASSWORD,
      },
    },
  }),

Adapters and Plugins

@payloadcms/email-nodemailer

yobottehg commented 1 month ago

Same error here. Was fine in 67 and breaks in 68.

email: undefined works .

The error comes up for us when we run payload migrate:create.

paulpopus commented 1 month ago

This will be fixed in the next beta release https://github.com/payloadcms/payload/pull/7326

github-actions[bot] commented 18 hours ago

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.