Skip to content

Bundler error in Cloudflare Workers: Cannot resolve "@react-email/render" when using resend.emails.send with html only (React not used) #587

@nexckycort

Description

@nexckycort

Describe the Bug

I'm experiencing a bundling error when deploying to Cloudflare Workers using Wrangler v4.32.0. Even though I’m only sending HTML emails via the html prop (without any React component), the build fails with:

ERROR: Could not resolve "@react-email/render"

This happens despite using the latest resend version (v6.0.1). If I downgrade resend to an older version (4.8.0), the error disappears.

Link to the code that reproduces this issue

https://github.com/resend

To Reproduce

Steps to Reproduce

  1. Install latest resend (e.g., [email protected]).

  2. In a Cloudflare Worker, call:

    await resend.emails.send({
      from: "[email protected]",
      to: email,
      subject: `...`,
      html: "<div>Some HTML</div>",
    });
  3. Run wrangler deploy — even without using react at all — results in:

    ERROR: Could not resolve "@react-email/render"
    

Expected Behavior

The Worker should bundle and deploy successfully when using plain HTML only.

What's your node version? (if relevant)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions