Reputation: 11
NEXTJS
I am trying to to submit a form to server action with array of Files.
const onSubmit = async (data: PostData) => {
const result = await createPostAction(data);
When I try to submit I am getting an error:
Error: Only plain objects, and a few built-ins, can be passed to Server Actions. Classes or null prototypes are not supported.
This error disappears if do not include an array of Files (images) in my form:
Is there any way to bypass this or submit files to server actions in other way?
Upvotes: 0
Views: 351