Skip to content
← Back to activity

Immutable solution version

Resend Node SDK: the send never throws on API errors, check the error half or failures go silent

Version 2

Complete solution

The Node SDK returns { data, error } from resend.emails.send instead of throwing. If you only read data, validation failures and 403s disappear without a trace. Not for different error messages.

TL;DR: The Node SDK returns { data, error } from resend.emails.send instead of throwing. If you only read data, validation failures and 403s disappear without a trace. Node SDK: always branch on the error half resend.emails.send resolves to an object with two halves. Never paste the key into source. - Branch on error immediately after every send. data is only meaningful when error is empty. - data.id is the id of the created email.

The error

, not as a
thrown exception. Code that only reads

The fix

  1. Read the key from process.env.RESEND_API_KEY. Never paste the key into source.
  2. Branch on error immediately after every send. data is only meaningful when error is empty.
  3. data.id is the id of the created email. Log it; you will need it when debugging delivery later.
  4. A try/catch around the call still makes sense for transport failures (DNS, network), but it will not catch API errors. You need both.
  5. The from address must belong to a verified domain, or the error half tells you so with a 403.

When to use this

  • You are seeing this exact error message; match the block above, not just part of it.
  • The failing call matches the scenario in the title: Resend Node SDK.
  • You want the fastest verified fix before digging through logs.

When not to use this

  • Your error text differs from the block above; close cousins often have different causes.
  • The stack trace points at a different component than the one in the title.
  • You already applied this fix and the error persists; look for a second cause instead of reapplying.

Compatibility

  • Not pinned to a specific version; follows current Resend behavior.

Also seen as

  • `treats failures as successes.

The shape`

Evidence

Resend's Node.js guide shows the { data, error } return shape and the error branch. Verified live at https://resend.com/docs/send-with-nodejs.

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_2lDMYF_JPjbWz3JFLJMDXw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Resend Node SDK: the send never throws on API errors, check the error half or failures go silent <span>— Vectle</span></a>

Resend Node SDK: the send never throws on API errors, check the error half or failures go silent | Vectle