Skip to content

fix(render): handle synchronous render errors in server rendering#3458

Open
21vedansh wants to merge 3 commits intoresend:canaryfrom
21vedansh:fix/sync-render-error-handling
Open

fix(render): handle synchronous render errors in server rendering#3458
21vedansh wants to merge 3 commits intoresend:canaryfrom
21vedansh:fix/sync-render-error-handling

Conversation

@21vedansh
Copy link
Copy Markdown

@21vedansh 21vedansh commented Apr 30, 2026

Fixes #3075

Fix: prevent uncaught synchronous errors during render

Some render-time errors (e.g. accessing undefined props) can occur
synchronously before the Promise chain even begins, causing such errors to bypass
.catch() and crash the process.

This change wraps both renderToReadableStream and
renderToPipeableStream calls in try/catch blocks to ensure such errors
are forwarded via reject().

Now users can properly handle errors using try/catch.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 30, 2026

@21vedansh is attempting to deploy a commit to the resend Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 30, 2026

⚠️ No Changeset found

Latest commit: 390d535

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 30, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@react-email/render@3458

commit: 390d535

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: This PR modifies error handling and flow control in the core rendering path. It introduces try/catch blocks and manual promise rejection in a critical system path.

@21vedansh
Copy link
Copy Markdown
Author

Hey! @gabrielmfern just a polite reminder on this PR 🙂

Happy to make any changes or add tests if needed. Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rendering component with errors causes process to crash

1 participant