Skip to content

how to use findById on Next.js #11834

Discussion options

You must be logged in to vote

See vercel/next.js#11993 . Do return { props: { pet: JSON.parse(JSON.stringify(pet)) } } instead. NextJS requires you to explicitly convert pet into an object that is representable in JSON beforehand. So no Date objects, no ObjectIds, etc.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SanityZeroPercent
Comment options

Answer selected by SanityZeroPercent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants