ant-design
ant-design copied to clipboard
next.js page router中,无法使用antd
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 |
是next 14的版本
报错是什么 能给个minimal可重现吗
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 将会被自动关闭。
https://codesandbox.io/p/devbox/antd-next-p4wgl5 测试无问题
https://codesandbox.io/p/devbox/antd-next-p4wgl5 测试无问题
你这个是app router,next14版本下的page router会报“Cannot use import statement outside a module”的es问题
感谢!