Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use import statement outside a module #619

Open
hqwlkj opened this issue Jan 29, 2024 · 4 comments
Open

Cannot use import statement outside a module #619

hqwlkj opened this issue Jan 29, 2024 · 4 comments

Comments

@hqwlkj
Copy link

hqwlkj commented Jan 29, 2024

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
Copy link
Author

hqwlkj commented Feb 4, 2024

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 可以帮忙看看什么原因吗?

@blackMoja
Copy link

I have same issue.
Is this issue still unresolved?

antd

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

@kkk360
Copy link

kkk360 commented Mar 4, 2024

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

@blackMoja
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants