blitz-js / next-superjson-plugin

SuperJSON Plugin for Next.js Pages and Components
192 stars 13 forks source link

Children are undefined in client components rendered by RSCs #63

Closed samtgarson closed 1 year ago

samtgarson commented 1 year ago

Verify Next.js canary release

Describe the bug

It seems that children passed to Client components with data-superjson attributes are not present in the client component?

Expected behavior

I would expect children to be passed through transparently to the Client component as it is without the superjson integration.

Reproduction link

https://github.com/samtgarson/appdir-reproduction-app/tree/superjson

Version

0.5.3

Config

/** @type {import("next").NextConfig} */
module.exports = {
  reactStrictMode: true,
  experimental: {
    appDir: true,
    swcPlugins: [["next-superjson-plugin", { excluded: ["children"] }]],
  },
};

(Have tried with and without the `excluded` option)

Additional context

No response

orionmiz commented 1 year ago

Thanks for reporting an issue!

The plugin v0.5.4 with bug fixes has been released.

samtgarson commented 1 year ago

Thanks for the quick fix 🙌