blitz-js / next-superjson-plugin

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

Plugin broke with Next 13.4.4 #84

Closed EvHaus closed 1 year ago

EvHaus commented 1 year ago

Verify Next.js canary release

Describe the bug

After upgrading from Next 13.4.3 to 13.4.4 using next-superjson-plugin now throws the following error during build:

- error ./node_modules/.pnpm/next@13.4.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/client/dev/amp-dev.js
Error: Filesystem cache is not enabled, cannot read plugin from phsyical path
- wait compiling...
- error ./node_modules/.pnpm/next@13.4.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/client/dev/amp-dev.js
Error: Filesystem cache is not enabled, cannot read plugin from phsyical path

Looks like that error is coming from swc but I'm not sure what changed between 13.4.3 and 13.4.4 that could use that.

Expected behavior

App should still run with next dev

Reproduction link

No response

Version

0.5.8

Config

// @ts-check

/**
 * @type {import('next').NextConfig}
 **/
module.exports = {
    experimental: {
        esmExternals: true,
        swcPlugins: [
            ['next-superjson-plugin', {}],
        ],
    },
    pageExtensions: ['page.tsx', 'page.ts'],
    reactStrictMode: true,
};


### Additional context

_No response_
kishan-getstarted commented 1 year ago

I got the same error yesterday. We are using nx workspace to run the nextjs application here are my configs

const withNx = require('@nx/next/plugins/with-nx');
const path = require('path');
/**
 * @type {import('@nx/next/plugins/with-nx').WithNxOptions}
 **/
const nextConfig = {
  pageExtensions: ['mdx', 'md', 'jsx', 'js', 'tsx', 'ts'],
  experimental: {
    swcPlugins: [["next-superjson-plugin", {}]],
  },
  sassOptions: {
    includePaths: [path.join(__dirname, 'styles')],
  },
  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);
Lagyu commented 1 year ago

I am experiencing the same error, by running yaarn build. Removing swcPlugins from nextConfig or reverting next version to 13.4.3 fixed the problem for me.

tarunfy commented 1 year ago

Hey, I got this same issue. Using: Nextjs 13.4.4

Screenshot 2023-06-02 at 3 07 57 PM
nekochan0122 commented 1 year ago

Same here

image

orionmiz commented 1 year ago

https://github.com/vercel/next.js/pull/50651

This PR will close the issue.

orionmiz commented 1 year ago

Please check out v13.4.5-canary.7