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

next.js page router中,无法使用antd

Open yukino2000 opened this issue 11 months ago • 6 comments

Reproduction link

https://ant.design/docs/react/use-with-next-cn

Steps to reproduce

按着antd官网的步骤来就报错了

What is expected?

正常使用antd

What is actually happening?

报错,Cannot use import statement outside a module

Environment Info
antd 5.15.3
React 18
System window
Browser chrome

yukino2000 avatar Mar 20 '24 12:03 yukino2000

是next 14的版本

yukino2000 avatar Mar 20 '24 12:03 yukino2000

报错是什么 能给个minimal可重现吗

CooperHash avatar Mar 20 '24 12:03 CooperHash

Hello @yukino2000. Please provide a online reproduction by forking codesandbox of [email protected] or [email protected], or provide a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 3 days.

你好 @yukino2000,我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击这里创建一个 [email protected][email protected] 的 codesandbox,或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。

什么是最小化重现,为什么这是必需的?

github-actions[bot] avatar Mar 20 '24 13:03 github-actions[bot]

https://codesandbox.io/p/devbox/antd-next-p4wgl5 测试无问题

CooperHash avatar Mar 20 '24 13:03 CooperHash

https://codesandbox.io/p/devbox/antd-next-p4wgl5 测试无问题

你这个是app router,next14版本下的page router会报“Cannot use import statement outside a module”的es问题

yukino2000 avatar Mar 20 '24 14:03 yukino2000

感谢!

yukino2000 avatar Mar 21 '24 02:03 yukino2000