You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I upgraded superjson to version 2.0.0 and ran the next build command, I got the following error:
info - Collecting page data ...Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\mongolyy\repos\next-app\node_modules\superjson\dist\index.js from C:\Users\mongolyy\repos\next-app\node_modules\babel-plugin-superjson-next\dist\tools.js not supported.
Instead change the require of index.js in C:\Users\mongolyy\repos\next-app\node_modules\babel-plugin-superjson-next\dist\tools.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (C:\Users\mongolyy\repos\next-app\node_modules\babel-plugin-superjson-next\dist\tools.js:64:19)
at Object.<anonymous> (C:\Users\mongolyy\repos\next-app\node_modules\babel-plugin-superjson-next\tools.js:1:18)
at 1421 (C:\Users\mongolyy\repos\next-app\.next\server\pages\cart.js:701:18)
at __webpack_require__ (C:\Users\mongolyy\repos\next-app\.next\server\webpack-runtime.js:25:42)
at C:\Users\mongolyy\repos\next-app\.next\server\pages\cart.js:66:91
at __webpack_require__.a (C:\Users\mongolyy\repos\next-app\.next\server\webpack-runtime.js:89:13)
at 8285 (C:\Users\mongolyy\repos\next-app\.next\server\pages\cart.js:60:21)
at __webpack_require__ (C:\Users\mongolyy\repos\next-app\.next\server\webpack-runtime.js:25:42)
at C:\Users\mongolyy\repos\next-app\.next\server\pages\cart.js:18:83
at __webpack_require__.a (C:\Users\mongolyy\repos\next-app\.next\server\webpack-runtime.js:89:13)
at 4411 (C:\Users\mongolyy\repos\next-app\.next\server\pages\cart.js:11:21)
at __webpack_require__ (C:\Users\mongolyy\repos\next-app\.next\server\webpack-runtime.js:25:42)
at __webpack_exec__ (C:\Users\mongolyy\repos\next-app\.next\server\pages\cart.js:914:39)
at C:\Users\mongolyy\repos\next-app\.next\server\pages\cart.js:915:85
at __webpack_require__.X (C:\Users\mongolyy\repos\next-app\.next\server\webpack-runtime.js:177:21)
at C:\Users\mongolyy\repos\next-app\.next\server\pages\cart.js:915:47
at Object.<anonymous> (C:\Users\mongolyy\repos\next-app\.next\server\pages\cart.js:918:3)
at requirePage (C:\Users\mongolyy\repos\next-app\node_modules\next\dist\server\require.js:156:12)
at C:\Users\mongolyy\repos\next-app\node_modules\next\dist\server\load-components.js:68:84
at async loadComponentsImpl (C:\Users\mongolyy\repos\next-app\node_modules\next\dist\server\load-components.js:68:26)
at async C:\Users\mongolyy\repos\next-app\node_modules\next\dist\build\utils.js:1002:32
at async Span.traceAsyncFn (C:\Users\mongolyy\repos\next-app\node_modules\next\dist\trace\trace.js:103:20) {
code: 'ERR_REQUIRE_ESM'
}
I think this is due to superjson becoming ES Module in 2.0.0.
Environement
Next.js version: 13.3.4
superjson version: 2.0.0
babel-plugin-superjson-next version: 0.4.4
The text was updated successfully, but these errors were encountered:
This might be related to settings in your tsconfig.json or the type field in your package.json. When you put import SuperJSON from "superjson" into one of your source files, does it fail with the same error?
When I upgraded superjson to version 2.0.0 and ran the
next build
command, I got the following error:I think this is due to superjson becoming ES Module in 2.0.0.
Environement
The text was updated successfully, but these errors were encountered: