blitz-js / next-superjson-plugin

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

Integration with @nrwl/nx #66

Closed shawnmclean closed 1 year ago

shawnmclean commented 1 year ago

Verify Next.js canary release

Describe the bug

I'm trying to implement this with a next.js project generated with nx.

Expected behavior

I'm still getting the same serialization error.

It gave the error that its picking up the swc config too: warn - You have enabled experimental feature (swcPlugins) in next.config.js..

If I update the string to something random, it throws an error, so that means it is running that swc plugin code I think.

Reproduction link

https://github.com/shawnmclean/next-superjson-nx

Version

0.5.4

Config

//@ts-check

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { withNx } = require('@nrwl/next/plugins/with-nx');

/**
 * @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
 **/
const nextConfig = {
  experimental: {
    swcPlugins: [['next-superjson-plugin', {}]],
  },
  nx: {
    // Set this to true if you would like to to use SVGR
    // See: https://github.com/gregberge/svgr
    svgr: false,
  },
};

module.exports = withNx(nextConfig);

Additional context

No response

orionmiz commented 1 year ago

Thank you for reporting the issue.

The commit that fixed the bug was included in v0.5.5 release.