Error: Only plain objects can be passed to Client Components from Server Components
Unanswered
Britannia Petite posted this in #help-forum
Britannia PetiteOP
Hey folks,
I'm passing data directly from prisma to my components, yet getting following error:
Only plain objects can be passed to Client Components from Server Components. Objects with symbol properties like nodejs.util.inspect.custom are not supported.
Any idea from where this could be coming wrong? Everything seems to be working though
I'm passing data directly from prisma to my components, yet getting following error:
Only plain objects can be passed to Client Components from Server Components. Objects with symbol properties like nodejs.util.inspect.custom are not supported.
Any idea from where this could be coming wrong? Everything seems to be working though
20 Replies
Bighead carp
Show the code that is causing the issue?
Britannia PetiteOP
@Bighead carp here you go
Bighead carp
You can't provide
any type as a prop typeYou need to create a type which fits the return type of that prisma query, and replace
anywith that typeBritannia PetiteOP
Why not? It won't affect runtime
Bighead carp
You screenshot half of the error message
I can't even see the full message
Britannia PetiteOP
sorry
Those are just properties of rate
Bighead carp
Construct a type which fits what is returned from the Prisma query, and use that as a replacement of
anyIf that doesn't work, let me know
Britannia PetiteOP
Yup, just did that, same issue
Bighead carp
Let's see the code
Britannia PetiteOP
Ok i think i found the reason
Has something to do with prisma $extends option
Error is gone after removing it...
Thanks!!
Bighead carp
make sure to mark the solution
Britannia PetiteOP
This is caused by https://www.prisma.io/docs/orm/prisma-client/client-extensions/result - I don't know how to solve it yet.
Next.js is getting mad even for something like this