blitz-js / next-superjson-plugin

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

Unsupported React Server Components (Next 13 exprimental appDir) #71

Closed AmazingTurtle closed 1 year ago

AmazingTurtle commented 1 year ago

This may or may not be a bug (because it's an experimental next feature, that we're talking about) but I wanted to bring this up anyway:

Warning: Only plain objects can be passed to Client Components from Server Components. Date objects are not supported.

is what you get with experimental appDir support when trying to pass data from a server component to a client component. Apparently that part of data transfer is not covered (yet). Here is the my next.config.js for curious readers:

module.exports = {
  experimental: {
    appDir: true,
    swcPlugins: [
      [
        'next-superjson-plugin',
        {
          excluded: []
        }
      ]
    ]
  }
};
Skn0tt commented 1 year ago

Hi @AmazingTurtle! I've transferred the issue to next-superjson-plugin, since that deals with the Next.js appDir integration :)

Skn0tt commented 1 year ago

I think there's some docs on the problem here: https://github.com/blitz-js/next-superjson-plugin#app-app-directory

If there's any other questions, @orionmiz is the right person to ask :)