Nylas Node.js SDK issue where sending email attachments larger than 3 MB fails in v7.13.3 but works after upgrading to v8.0.2, raising concerns about potential breaking changes

I’m using Node.js 24.12.0, and attachments were previously working fine for me with the Nylas SDK v7.13.3. However, I’ve suddenly started getting the following error when sending messages with attachments:

request must be of content-type multipart/form-data or application/json

After debugging, I found that this issue only occurs when the attachment size exceeds 3 MB. Smaller attachments continue to work as expected.

I tried upgrading the Nylas SDK to v8.0.2, and that resolves the problem. However, I’m concerned about whether upgrading might introduce breaking changes or affect other parts of my integration.

Below is the code snippet I’m using to send messages with attachments:

nylas.messages.send({
  identifier: grantId,
  requestBody: {
    body,
    subject,
    to,
    attachments: attachments?.map((attachment) => ({
      content: (attachment.contentStream || attachment.contentBase64)!,
      contentType: attachment.contentType,
      filename: attachment.filename,
      contentId: attachment.contentId,
      isInline: attachment.isInline,
      contentDisposition: attachment.contentDisposition,
      size: attachment.size,
    })),
    trackingOptions,
  },
});

Is there a recommended fix or configuration change, or is upgrading to v8 the correct long-term solution?

Hello,

That is correct. Using the latest Node SDK version is the recommendation. Please let us know if you face any issues.

Many thanks,
Samuel R.
Support Engineer, Nylas

1 Like