with-nextjs does not work with antd v5
the new example with-nextjs does not work with antd v5
npm create refine-app@latest -- --example with-nextjs
cd with-nextjs
npm run start error - /with-nextjs/node_modules/antd/es/anchor/style/index.js:1 import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; ^^^^^^ SyntaxError: Cannot use import statement outside a module at Object.compileFunction (node:vm:352:18) at wrapSafe (node:internal/modules/cjs/loader:1033:15) at Module._compile (node:internal/modules/cjs/loader:1069:27) at Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:3
npm run start error - /with-nextjs/node_modules/antd/es/anchor/style/index.js:1 import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; ^^^^^^ SyntaxError: Cannot use import statement outside a module at Object.compileFunction (node:vm:352:18) at wrapSafe (node:internal/modules/cjs/loader:1033:15) at Module._compile (node:internal/modules/cjs/loader:1069:27) at Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:3
2 Replies
ratty-blushā¢2y ago
Hey @maxdata,
You can see the warning in the Migration Guide of Ant Design v5 https://refine.dev/docs/api-reference/antd/migration-guide/v4-to-v5/
Unfortunately, there are some components in ant design presented only in ESM and fails to load in CJS bundlers.
We're looking for a fix from the antd side but if this is going to be something permanent, we'll be looking for alternatives to fix this as soon as possible.
š
Migration Guide | refine
Ant Design released a new major version as a v5. This document will help you upgrade from antd 4.x version to antd 5.x version.
extended-salmonā¢2y ago
Thank you!