-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot access displayName.valueOf on the server #96
Labels
bug
Something isn't working
Comments
Can confirm that this error is only occurring for components being rendered in loops, with Components using I've worked around this wtih a horrible component to effectively move the export function Wrap<P>({
c: Component,
props
}: {
c: ComponentType<P>
props: P
}) {
return <Component {...props} data-superjson />
}
// usage
<Wrap c={MyClientComponent} props={{ props }} /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Verify Next.js canary release
Describe the bug
I use this plugin very heavily in a small production app, thanks for the OSS!
Trying to upgrade to Next 14 and any RSCs with the
data-superjson
attribute anywhere in their tree completely error out, with the following error:I have been able to narrow this down with pretty high confidence to this plugin, although it's very difficult to debug.
Some research indicates that this issue can display in Next.js when arrays of children are rendered on the server without a
key
prop (e.g.). I have been seeing #70 for a long time throughout my app, although it's been ignorable but this doesn't seem to be a coincidence—I wonder if it's possible that thekey
attribute is getting lost through this plugin.(I do still get the
Warning: Each child in a list should have a unique "key" prop
stacktrace next to the above error)Expected behavior
The page does not explode and the plugin works as described.
Reproduction link
Not available but I can add users to a private repo if it would help
Version
superjson 1.13.3, next-superjson-plugin 0.5.10, next 14.0.3
Config
Additional context
As mentioned, this is very difficult to debug without a real stack trace, the error points at the parent of the
data-superjson
element, so any advice in debugging this further and I would be happy to investigate myself.The text was updated successfully, but these errors were encountered: