I'm getting the following error on one of my pages:
SerializableError: Error serializing `.meta` returned from `getServerSideProps` in "/account-settings".
Reason: `undefined` cannot be serialized as JSON. Please use `null` or omit this value all together.
I've tried multiple variations of setting user to null, but none seem to fix the issue. My guess is that babel-plugin-superjson-next is leaving its .meta field as undefined (a rare case, but something that makes sense for a redirect, for instance), and Next.js throws an error on that case.
Changing the last line to the following, however, avoids this issue:
I'm getting the following error on one of my pages:
Here's my code:
I've tried multiple variations of setting user to null, but none seem to fix the issue. My guess is that babel-plugin-superjson-next is leaving its
.meta
field as undefined (a rare case, but something that makes sense for a redirect, for instance), and Next.js throws an error on that case.Changing the last line to the following, however, avoids this issue: