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
25.72k stars 1.64k forks source link

Build Error: `payload/error` could not resolve package in Resend email package #9100

Closed theHoracle closed 1 week ago

theHoracle commented 1 week ago

Describe the Bug

The payload resend email package is broken - ` ⨯ ./node_modules/.pnpm/@payloadcms+email-resend@3.0.0-beta.29_payload@3.0.0-beta.121_graphql@16.9.0_monaco-editor@0._srgwrjl2b7cefuyhbajcvxefse/node_modules/@payloadcms/email-resend/dist/index.js:1:1 Module not found: Can't resolve 'payload/errors'

1 | import { APIError } from 'payload/errors'; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | /* 3 | Email adapter for Resend REST API 4 | */ export const resendAdapter = (args)=>{

https://nextjs.org/docs/messages/module-not-found `

Link to the code that reproduces this issue

https://github.com/theHoracle/donner-payload3b.git

Reproduction Steps

pnpm add @payloadcms/email-resend

then in payload.config ` import { resendAdapter } from '@payloadcms/email-resend'

export default buildConfig({ email: resendAdapter({ defaultFromAddress: 'info@foundation.com', defaultFromName: 'Foundation', apiKey: process.env.RESEND_API_KEY || '', }), }) `

Which area(s) are affected? (Select all that apply)

plugin: other

Environment Info

cross-env NODE_OPTIONS=--no-deprecation payload "info"

Binaries:
  Node: 22.9.0
  npm: 10.8.3
  Yarn: 1.22.22
  pnpm: 9.12.2
Relevant Packages:
  payload: 3.0.0-beta.121
  next: 15.0.2
  @payloadcms/db-mongodb: 3.0.0-beta.121
  @payloadcms/email-nodemailer: 3.0.0-beta.121
  @payloadcms/email-resend: 3.0.0-beta.29
  @payloadcms/graphql: 3.0.0-beta.121
  @payloadcms/next/utilities: 3.0.0-beta.121
  @payloadcms/payload-cloud: 3.0.0-beta.121
  @payloadcms/richtext-lexical: 3.0.0-beta.121
  @payloadcms/translations: 3.0.0-beta.121
  @payloadcms/ui/shared: 3.0.0-beta.121
  react: 19.0.0-rc-b7e21579-20241031
  react-dom: 19.0.0-rc-b7e21579-20241031
Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:02:27 PDT 2024; root:xnu-11215.41.3~2/RELEASE_X86_64
  Available memory (MB): 8192
  Available CPU cores: 4
r1tsuu commented 1 week ago

Hey @theHoracle! Looks like your installed version of @payloadcms/email-resend is 3.0.0-beta.29, while other packages are on 3.0.0-beta.121. They should be all on the same version, try to run pnpm add @payloadcms/email-resend@3.0.0-beta.121

github-actions[bot] commented 6 days ago

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