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

I ran into the same issue, and it doesn’t seem like something you’re doing wrong—v7.x of the Nylas SDK has quirks with how it handles larger attachments, especially around switching between JSON and multipart requests, which is why things break past ~3 MB. Upgrading to v8.0.2 is honestly the right long-term fix since they’ve improved attachment handling internally, and in my experience the migration isn’t too painful if your implementation is straightforward like yours—just review the changelog and test key flows to be safe. There’s no reliable workaround in v7 for this, so sticking with v8 makes more sense going forward, and while organizing my own setup I also found this helpful website for keeping things structured.