Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All builds failing with react-email templates on Next.js 14 with error "Cannot get final name for export 'encodeXML'" #1499

Open
WoetDev opened this issue Jun 9, 2024 · 3 comments

Comments

@WoetDev
Copy link

WoetDev commented Jun 9, 2024

Describe the Bug

I'm having a blocking issue for all my builds with Next.js 14.2.3:

Cannot get final name for export 'encodeXML' of ./react-email/node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/index.js

It seems that this is already a long-standing issue that has been closed without proper resolution: #1015

The mentioned workarounds do also not work for me:

  1. Tried to use the render function to first render the react component to HTML and send the email
  2. Tried to add the following to my next.config.js:
experimental: {
    serverComponentsExternalPackages: ["@react-email/components"],
  },

Not using the Edge runtime on my page

  1. Tried setting my page as a client component with "use client" at the top

Used packages:

"@react-email/components": "^0.0.19",
"react-email": "^2.1.4",

Which package is affected (leave empty if unsure)

No response

Link to the code that reproduces this issue

private

To Reproduce

Create a next 14 project and use the following packages:

"@react-email/components": "0.0.19",
"react-email": "2.1.4",

Expected Behavior

Build succeeds

What's your node version? (if relevant)

v20.13.1

@WoetDev
Copy link
Author

WoetDev commented Jun 9, 2024

Defaulted back to send the email by plain text for now so my build succeeds.

If the issue keeps being unresolved, I'll probably have no option than to look into an alternative on how to handle the HTML templating and with which service. Which is a shame cause the development experience was great until it came to now having it work on production.

@gabrielmfern
Copy link
Collaborator

Can you make an actual reproduction of this? Something I can clone and get up and running quickly because the original issue there was fixed, and it isn't present anymore. Your issue seems to be something else.

@WoetDev
Copy link
Author

WoetDev commented Jun 15, 2024

@gabrielmfern thanks for getting back to me. I'll see if I can find time to create smth to reproduce the issue. Although I think it might also be something from the resend package and I could be in the wrong place here.

Cause I currently managed to get around it by sending the HTML email from an edge API route instead of sending the email directly from my server action on the edge runtime, so in the server action I only send a POST request to the API route to trigger the email send and this worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants