Next.js Discord

Discord Forum

Getting new error after updating to 14.2.0

Answered
Schneider’s Smooth-fronted Caima… posted this in #help-forum
Open in Discord
Schneider’s Smooth-fronted CaimanOP
I just updated my project from 14.1.4 to 14.2.0, and as soon as I ran the app it started giving me a "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."

I did a bit of digging, and found that it was being caused by my passing of Kysely result objects into a client component, which are null prototypes.

I also found that I can fix it by wrapping the object in the structuredClone() function, but I'm wondering why this started happening in the first place, and if there's any way I can change it so that I don't have to go wrap every object in the site with structuredClone() ?

Was it a bug in the first place that I just had bad timing on, or is null prototypes being disallowed new for 14.2.0?
Answered by Schneider’s Smooth-fronted Caiman
After updating from 14.2.0 to 14.2.2 it looks that this was just a bug, it's been fixed, and I was able to remove the structuredClone() wrapper around each object I was passing in!
View full answer

1 Reply

Schneider’s Smooth-fronted CaimanOP
After updating from 14.2.0 to 14.2.2 it looks that this was just a bug, it's been fixed, and I was able to remove the structuredClone() wrapper around each object I was passing in!
Answer