ant-design-icons icon indicating copy to clipboard operation
ant-design-icons copied to clipboard

Cannot use import statement outside a module

Open hqwlkj opened this issue 1 year ago • 4 comments

image

Next.js

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 20.6.0: Thu Jul  6 22:12:47 PDT 2023; root:xnu-7195.141.49.702.12~1/RELEASE_X86_64
Binaries:
  Node: 18.18.2
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 7.16.0
Relevant Packages:
  next: 14.1.0
  eslint-config-next: 14.1.0
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: standalone

antd


"@ant-design/icons": "^5.2.6",
"antd": "^5.13.1",


hqwlkj avatar Jan 29 '24 01:01 hqwlkj

image

Next.js

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 20.6.0: Thu Jul  6 22:12:47 PDT 2023; root:xnu-7195.141.49.702.12~1/RELEASE_X86_64
Binaries:
  Node: 18.18.2
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 7.16.0
Relevant Packages:
  next: 14.1.0
  eslint-config-next: 14.1.0
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: standalone

antd


"@ant-design/icons": "^5.2.6",
"antd": "^5.13.1",

@afc163 可以帮忙看看什么原因吗?

hqwlkj avatar Feb 04 '24 04:02 hqwlkj

I have same issue. Is this issue still unresolved?

antd

"@ant-design/icons": "^5.3.0",
"antd": "^5.14.1",

blackMoja avatar Feb 14 '24 06:02 blackMoja

If you are using nextjs 14, You can modify the next.config.js file, add const nextConfig = { ... , transpilePackages: ["@ant-design/icons"], }

kkk360 avatar Mar 04 '24 08:03 kkk360

@kkk360 Thanks. It works :) Is that in the official document?

blackMoja avatar Apr 24 '24 04:04 blackMoja

Fixed in @ant-design/[email protected]: https://github.com/ant-design/ant-design-icons/pull/653

afc163 avatar Jul 21 '24 06:07 afc163