-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Bug: Can't send ArrayBuffer to Server Action despite react.dev saying so #27931
Comments
I'm having the same issue. |
Wokraround: I've tested multiple react/nextjs version combinations and now found working one. For me it's nextjs 13.5.6 and react 18.2.0. Reply pls when you try it out) |
I will test. I'm using |
The workaround i have for now is to wrap the data with FormData first and append the file before sending it to the server action |
It seems that shipping |
as per the documentation, that is the intended behavior |
They're supported as return values in Server Actions in React's Experimental release channel. Sending I'll file a PR updating the docs accordingly. |
Will be supported by #28819 |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you! |
Can't send ArrayBuffer to Server Action despite react.dev saying that you can. I'm not sure if this is an error or my part or the documentation. I retrieved the arrayBuffer from file of formData, then pass it through the parameter of the Server Action.
It seems like it doesn't get sent to the server because it can't be parsed due to ArrayBuffer being serializable but not iterable.
However this is somewhat confusing because you can attach File in FormData in the form of Blob and send it to the Server Action.
I understand that FormData is handled separately but I'm not sure I understand why it can't be done the same with ArrayBuffer.
I understand that I can just pass the FormData to send files but In my case I needed to transform the Files first before uploading and it ends up with a Blob.
React version:
Steps To Reproduce
Link to code example:
https://codesandbox.io/p/devbox/nextjs-arraybuffer-server-action-36gvxn
The current behavior
Throws client-side error
The expected behavior
ArrayBuffer gets sent to the server
The documentation:
Please let me know if I fail to understand the documentation or if it's something wrong in the documentation
The text was updated successfully, but these errors were encountered: