Skip to content

in a custom app getInitialProps the first own prop is [Function: withSuperJSON] instead of the value #89

@neotrow

Description

@neotrow

Verify Next.js canary release

  • I verified that the issue exists in the latest Next.js canary release

Describe the bug

I'm trying to return props from a custom app getInitialProps function. But for some reason the first own property is always [Function: withSuperJSON] instead of the actual property.

Example here:
https://github.com/neotrow/next-superjson-test/blob/main/pages/_app.tsx#L30

Expected behavior

I would expect the above mentioned console log to be
ownProps { prop1: 'foo', prop2: 'bar', prop3: 'baz' }
and not
ownProps { prop1: [Function: withSuperJSON], prop2: 'bar', prop3: 'baz' }

Reproduction link

https://github.com/neotrow/next-superjson-test

Version

0.5.9

Config

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  experimental: {
    swcPlugins: [["next-superjson-plugin", {}]],
  },
};

module.exports = nextConfig;

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions