My n00b self is stumped on this error.
Next.js/Prisma/Postgres
github.com/Shpigford/josh
Conversation
Replying to
I really wish they use a serializer automatically in next but here’s the solution
1
5
Show replies
Replying to
Date objects aren’t actual JSON- need to convert what you’re getting from planetscale into a string for those fields. Might be able to just do something like calling “JSON.stringify” on it, then serialize- but they may have something better built in
2
Replying to
You can pass a custom serializer in json.stringify to handle dates but I forget how and am on my phone.
1
Replying to
A similar issue happen with Firebase sometimes. I've not used the solution that sharno🐌 had posted — looks interesting.
Declaring the type works for me. Example: `(createdAt as Timestamp).toDate()`





