You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting from version 4.0.4 of jira.js, the library replaced form-data with formdata-node to improve ESM compatibility. The change was introduced as part of #327 to resolve compatibility issues with ESM projects. While this change resolves compatibility issues with ESM projects, it introduces a regression: the inability to upload large files via Node.js ReadableStream without loading the entire file into memory and breaks backward compatibility.
In previous versions (e.g., 3.0.5), form-data allowed seamless usage of ReadableStream for large file uploads. However, formdata-node does not natively support Node.js ReadableStream, and the same code now results in errors when attempting to upload attachments.
Steps to Reproduce:
Upgrade to jira.js version 4.0.4 or higher.
Create a file as a ReadableStream in Node.js.
Attempt to upload the file as an attachment to Jira using the provided API.
Observe that the upload fails with error "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'."
Thank you for the fix!
I just checked it, and it works now. However, I noticed a potential issue with memory usage because files are uploaded through memory.
I believe this would only be relevant for large files, so I created a separate issue #353 to address it.
Feel free to take a look if you think it's worth discussing further.
Description:
Starting from version 4.0.4 of
jira.js
, the library replacedform-data
withformdata-node
to improve ESM compatibility. The change was introduced as part of #327 to resolve compatibility issues with ESM projects. While this change resolves compatibility issues with ESM projects, it introduces a regression: the inability to upload large files via Node.jsReadableStream
without loading the entire file into memory and breaks backward compatibility.In previous versions (e.g.,
3.0.5
),form-data
allowed seamless usage ofReadableStream
for large file uploads. However,formdata-node
does not natively support Node.jsReadableStream
, and the same code now results in errors when attempting to upload attachments.Steps to Reproduce:
jira.js
version4.0.4
or higher.ReadableStream
in Node.js.Example Code:
Code that worked in version
3.0.5
:The same code will fail in
4.0.4
with error "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'."Expected Behavior:
Files should be uploaded seamlessly using Node.js
ReadableStream
, as was possible in version3.0.5
.Actual Behavior:
Uploads fail when attempting to use Node.js
ReadableStream
for file attachments. The same code that worked in version3.0.5
now results in errors.Environment:
jira.js version: 4.0.4 or later
Node.js version: 20.11.0
OS: macOS Sequoia 15.2
The text was updated successfully, but these errors were encountered: