Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to upload item data with addItemData() #1033

Open
haoliangyu opened this issue Oct 21, 2022 · 1 comment
Open

Unable to upload item data with addItemData() #1033

haoliangyu opened this issue Oct 21, 2022 · 1 comment

Comments

@haoliangyu
Copy link
Member

haoliangyu commented Oct 21, 2022

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 a Item 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 and volta run node index.js to reproduce the problem.

Logs

There is no error log.

System Info

System:
    OS: macOS 12.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 581.50 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.18.0 - ~/.volta/tools/image/node/16.18.0/bin/node
    Yarn: 1.22.10 - ~/.volta/tools/image/yarn/1.22.10/bin/yarn
    npm: 8.19.2 - ~/.volta/tools/image/npm/8.19.2/bin/npm
  Browsers:
    Chrome: 106.0.5249.119
    Safari: 15.6.1
  npmPackages:
    @esri/arcgis-rest-request: ^4.0.0 => 4.1.1

Additional Information

No response

@haoliangyu
Copy link
Member Author

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: form-data/form-data#520, form-data/form-data#503, form-data/form-data#508. But since rest-js 2.x and 3.x are no longer supported, I only submit the issue for 4.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant