I have developed an application using NextJS
version 14. I am currently working on implementing server actions in a straightforward form that takes two files as input and returns one file as output.
I'm facing an issue with the current implementation. Upon trying to return the file, an error is thrown. Below is a snippet of my code:
CMSForm.tsx
export default function CMSForm() {
// Code here
}
Additionally, here is the relevant action snippet:
'use server'
// Action code here
The error message I encounter is:
Error: Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported
I am uncertain whether server actions can handle this functionality efficiently. An alternative solution could involve utilizing a Route handler and managing the download process within the client component instead.
Your assistance in resolving this matter would be greatly appreciated. Thank you for taking the time to review.