nylas-nodejs icon indicating copy to clipboard operation
nylas-nodejs copied to clipboard

ReferenceError: require is not defined

Open loremaps opened this issue 1 year ago • 2 comments

Describe the bug

When we send a message with an attachment that exceeds Messages.MAXIMUM_JSON_ATTACHMENT_SIZE causes the error:

ReferenceError: require is not defined

image

To Reproduce

Send a message with a pdf file attachment of more than 4MB in size. Use SDK version `7.6.2` and esm. 

Expected behavior

Send the message without an error.

SDK Version:

The issue happens with version 7.6.2. With version 7.5.2 is works.

It seems to be broken after implementation of #586

Additional context

{
  "app": {
    "app_start_time": "2024-11-26T06:43:21.196Z",
    "app_memory": 205467648,
    "free_memory": 164134912,
    "type": "app"
  },
  "browser": {
    "name": "axios",
    "version": "1.7.7",
    "type": "browser"
  },
  "culture": {
    "locale": "en-US",
    "timezone": "UTC",
    "type": "culture"
  },
  "device": {
    "arch": "x64",
    "memory_size": 16780316672,
    "free_memory": 10111979520,
    "boot_time": "2024-10-27T03:13:52.112Z",
    "processor_count": 2,
    "cpu_description": "Intel(R) Xeon(R) CPU @ 2.20GHz",
    "processor_frequency": 0,
    "type": "device"
  },
  "os": {
    "name": "Alpine Linux",
    "version": "3.20.3\n",
    "kernel_version": "6.1.100+",
    "type": "os"
  },
  "runtime": {
    "name": "node",
    "version": "v22.11.0",
    "type": "runtime"
  }
}

loremaps avatar Nov 27 '24 12:11 loremaps

Same error here, any solutions? I had to fork and manually go back to the previous import (https://github.com/nsantos16/nylas-nodejs/commit/0676a616485e2f9b6ca8b7faea86bc1dd11bb84f)

nsantos16 avatar Feb 04 '25 23:02 nsantos16

Same issue here! Please help!

thekennysong avatar Feb 04 '25 23:02 thekennysong

+1

oleksiisemenovu avatar Jun 25 '25 18:06 oleksiisemenovu

Hey - this should be fixed in 7.12.0. If it isn't, please reopen this issue. Thanks.

AaronDDM avatar Aug 01 '25 16:08 AaronDDM