Hi. I'm getting an error. 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. It posts to the database on submit, but then throws the error. It doesn't indicate which component is causing the problem.
I think you are passing unserializable data. react.dev/reference/rsc/use-server#serializable-parameters-and-return-values If you are passing a mongoose response try calling to `toObject` method. i.e `blog.toObject()`
@@CulesCoding Hi. Thanks for getting back. I think it is caused by "return newPost.save();" in the action file. It replicates what you did, so I don't know why it's giving me an error and not you!
Hi! You just explained in 16 minutes something that I could not find anywhere else!
I cant express how helpfull this vid is ,Really thankfull for this
Glad it helped
I needed this the other day. Super handy video, thanks! 😀
Glad it was helpful!
Je viens de découvrir la chaîne RUclips,je m'abonne
thank you
Thanks a lot
Hi. I'm getting an error.
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.
It posts to the database on submit, but then throws the error. It doesn't indicate which component is causing the problem.
I think you are passing unserializable data. react.dev/reference/rsc/use-server#serializable-parameters-and-return-values
If you are passing a mongoose response try calling to `toObject` method. i.e `blog.toObject()`
@@CulesCoding Hi. Thanks for getting back. I think it is caused by "return newPost.save();" in the action file. It replicates what you did, so I don't know why it's giving me an error and not you!
may be try removing the `return` keyword and await the save method.