Next.js: 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
A Server Component passed a non-serialisable value (class instance, Date-like object, Mongoose doc, Map) as a prop to a Client Component.
Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supportedOnly plain objects can be passed to Client Components from Server ComponentsError: Objects are not valid as a React child Next.js server componentOnly plain objects can be passed to Client Components. Classes or null prototypes are not supported Meaning
Props must be serialisable. Convert Mongoose/Prisma results to plain objects (JSON.parse(JSON.stringify(doc)), .lean(), toObject()), pass ISO strings instead of Date objects in some cases, and don't pass class instances, functions or Maps. The error shows the offending prop name.
Common causes
- Mongoose documents passed as props
- Class instances/ORM models
- ObjectId/Decimal values
- Functions as props (separate error)
Map/Setor objects withtoJSONgetters
⚡ Quick fix
- Use
.lean()for Mongoose queries - Map to plain DTO objects before passing
- Convert dates to strings
Detailed fix by platform
Next.js
const posts = await Post.find().lean(); return <PostList posts={JSON.parse(JSON.stringify(posts))} />;
How to diagnose
- Prop — Which one?
- Type — Class or ORM document?
- Fix — lean/DTO?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- CastError ObjectId CastError: Cast to ObjectId failed for value "x" (type string) at path "_id"
- circular JSON TypeError: Converting circular structure to JSON
- Conflicting app and page file was found Next.js: ⨯ Conflicting app and page file was found, please remove the conflicting files to continue: "pages/index.tsx" - "app/page.tsx"
Most viewed in Next.js
- NEXT_REDIRECT Next.js: Error: NEXT_REDIRECT (redirect() inside try/catch)
- server-only Next.js: You're importing a component that needs "server-only". That only works in a Server Component
- cookies() should be awaited Next.js 15: Route "/x" used `cookies().get('token')`. `cookies()` should be awaited before using its value
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026