blitz-js / next-superjson-plugin

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

dev error #50

Closed hehehai closed 1 year ago

hehehai commented 1 year ago

Verify Next.js canary release

Describe the bug

I'll use superjson to solve problem https://github.com/vercel/next.js/issues/13209 first.

use babel superjson that's working, bug swc plugin has error.

Expected behavior

next dev no error.

Reproduction link

No response

Version

0.4.9

Config

next.config.js

/** @type {import('next').NextConfig} */

module.exports = {
  experimental: {
    swcPlugins: [
      [
        "next-superjson-plugin",
        {
          excluded: [],
        },
      ],
    ],
  },
};

Additional context

package.json

"dependencies": {
    "@next-auth/prisma-adapter": "^1.0.5",
    "@prisma/client": "^4.6.0",
    "next": "12.2.6",
    "next-auth": "^4.16.4",
    "next-superjson-plugin": "^0.4.9",
    "prisma": "^4.6.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-markdown": "8.0.0",
    "superjson": "^1.11.0"
  },
  "devDependencies": {
    "@types/node": "18.11.9",
    "@types/react": "18.0.25",
    "ts-node": "^10.9.1",
    "typescript": "4.8.4"
  },

tsconfig.json

{
  "compilerOptions": {
    "target": "ES2019",
    "lib": [
      "DOM",
      "DOM.Iterable",
      "ESNext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "ESNext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "baseUrl": ".",
    "paths": {
      "~/lib/*": [
        "lib/*"
      ],
      "~/components/*": [
        "components/*"
      ]
    }
  },
  "exclude": [
    "node_modules"
  ],
  "include": [
    "next-env.d.ts",
    "**/*.ts",
    "**/*.tsx"
  ]
}
orionmiz commented 1 year ago

"next": "12.2.6"

Use older version of the plugin for backward compatibility.