formData.set is not a function on the ipfs-http-client lib
-
Version:
54.0.0fromyarn add ipfs-http-client -
Platform:
-
M1 Big Surwith11.6version -
ReactJSwith17.0.2version -
Chrome (Official Build) (arm64)with95.0.4638.69version
Severity: High
Description:
- What you did: I just want to learn how the client upload the image into the
ipfsand I used theReactJSframework withipfs-http-clientlibrary - What happened: An error has occurred when I am using the
ipfs.add()function withformData.set is not a functionin themultipart-request.browser.jsfile - What you expected to happen: I just wonder why this error has occurred? and I struggle with this error for a while and try to change
formData.settoformData.appendfunction, it works! Hence, can you look into this error for inspecting the root cause and providing detail about it?
Steps to reproduce the error:
This is an error on the google chrome console:
This is the code in ipfs-http-client lib at multipart-request.browser.js file that made this error
This is my implementation code and it's working now after I changed formData.set to formData.append
Thanks in advance!
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:
- "Priority" labels will show how urgent this is for the team.
- "Status" labels will show if this is ready to be worked on, blocked, or in progress.
- "Need" labels will indicate if additional input or analysis is required.
Finally, remember to use https://discuss.ipfs.io if you just need general support.
@BankNatthapon what bundler setup are you using for building your app?
Both set and append are in the same spec and supported since Chrome 50: https://developer.mozilla.org/en-US/docs/Web/API/FormData#browser_compatibility
Perhaps you have some custom browser-compatibility setup as part of your build pipeline?
Assuming no longer an issue? Feel free to fill new one or ask on discuss forums.