My NextJs project was working fine as I was signed in. As soon as signed out, I faced this Unhandled Runtime Error: 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. PLEASE HELP!
The strange thing is that the error is only occurring when I am trying to sign in from localhost:3000. When I tried opening localhost:3000/image. I successfully got the option to log in.
The problem is occurring somewhere around here, because I commented out the parts shown in the image, and I got the home page rendered. No Sign In option though.
AFAICT you are trying to serialize a class instance or null to JSON somewhere in your Next.js code, probably with JSON.stringify()
, and this is not supported, as per what the error message says. And this occurs after a timeout expires.