Next.js Discord

Discord Forum

Error: Only plain objects can be passed to Client Components from Server Components

Unanswered
Britannia Petite posted this in #help-forum
Open in Discord
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

20 Replies

Southern rough shrimp
Show the code that is causing the issue?
Britannia PetiteOP
@Southern rough shrimp here you go
Southern rough shrimp
You can't provide any type as a prop type
You need to create a type which fits the return type of that prisma query, and replace anywith that type
Britannia PetiteOP
Why not? It won't affect runtime
Southern rough shrimp
You screenshot half of the error message
I can't even see the full message
Britannia PetiteOP
sorry
Those are just properties of rate
Southern rough shrimp
Construct a type which fits what is returned from the Prisma query, and use that as a replacement of any
If that doesn't work, let me know
Britannia PetiteOP
Yup, just did that, same issue
Southern rough shrimp
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!!
Southern rough shrimp
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