Next.js 14.1.4 fails to build when using antd due to "SyntaxError: Cannot use import statement outside a module" #48455
Unanswered
kaviyarasank
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
here, i am using antd charts and antd package for my next js project. unable to get a build . Because error showing. And i tryed some solutions like added transpilePackages in next.config.js file. But not resolved.
✓ Checking validity of types
unhandledRejection /home/kaviyarasan/Music/e-commerce/node_modules/rc-util/es/omit.js:1
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1175:20)
at Module._compile (node:internal/modules/cjs/loader:1219:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
at Module.load (node:internal/modules/cjs/loader:1113:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1137:19)
at mod.require (/home/kaviyarasan/Music/e-commerce-revsure/node_modules/next/dist/server/require-hook.js:65:28)
at require (node:internal/modules/helpers:121:18)
at 5514 (/home/kaviyarasan/Music/e-commerce-revsure/.next/server/pages/_app.js:1:5657) {
type: 'SyntaxError'
}
Collecting page data .%
Beta Was this translation helpful? Give feedback.
All reactions