Skip to content

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

Closed as not planned
@WoetDev

Description

@WoetDev

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions