Open haoliangyu opened 2 years ago
At rest-js 2.x and 3.x, there is another problem with the addItemData
function. It may cause the socket hang up
error in the update request. I have seen a few issues related to the form-data
library and nodejs Readable stream: https://github.com/form-data/form-data/issues/520, https://github.com/form-data/form-data/issues/503, https://github.com/form-data/form-data/issues/508. But since rest-js 2.x and 3.x are no longer supported, I only submit the issue for 4.x.
Describe the bug
I am trying to use the
addItemData
function in node 16 to upload file data to an already created item. It doesn't throw any error but the file is actually not uploaded. When I try to download the item file, it shows aItem does not have a file.
error page.This bug happens at rest-js 4.x.
Reproduction
You can reproduce the problem by running the repository https://github.com/haoliangyu/arcgis-rest-js-node-16-bug. You can run
volta run yarn
andvolta run node index.js
to reproduce the problem.Logs
System Info
Additional Information
No response