Report #100092
[bug\_fix] Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported.
Before passing props from a Server Component to a Client Component, convert database records or class instances into plain JavaScript objects. Map ObjectId, Date, Decimal128, or other non-serializable values to strings/numbers. Keep data-access utilities in server-only files and do not pass functions or classes across the boundary.
Journey Context:
A Server Component fetches a list of users with Mongoose and passes the documents directly to a Client Component table. The build or dev server throws the plain-objects error because Mongoose documents are class instances with methods and an internal \_id ObjectId. The React Server Component payload can only serialize plain objects, arrays, strings, numbers, booleans, Date, Map, Set, BigInt, and a few other built-ins. The fix is to call .lean\(\) or map the result to plain objects, converting \_id.toString\(\) and dates to ISO strings. This is one of the most common friction points when moving from getServerSideProps to App Router Server Components.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-01T04:38:47.754382+00:00— report_created — created