Skip to content

error: Cannot find module '@react-email/render' on production build #2474

@DCKT

Description

@DCKT

Describe the Bug

Hi there,

I just encountered this issue after trying to deploy my app.
I'm using TanStack start with Bun.

It works very well on dev mode but after building the prod, the error appear

error: Cannot find module '@react-email/render'

Things I tried without success :

  • install @react-email/render
  • downgrade resend sdk (6.x.x, 5.x, 4.x)
  • use pnpm and node LTS
  • update bun (from 1.2.2 to latest ATM 1.2.9)

I made a repo with a simple repro using the tanstack starter

Link to the code that reproduces this issue

https://github.com/DCKT/resend-react-email-error

To Reproduce

  1. import somewhere in the project the @react-email/components
  2. build the app through bun run build
  3. launch the app bun run .ouput/server/index.mjs
  4. access http://localhost:3000

The error is raised directly.

Expected Behavior

Should not crash on production build

What's your node version? (if relevant)

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions