-
-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
nextjs引入antd/es/button报错Cannot use import statement outside a module #43233
Comments
还有个问题就是,nextjs引入antd以后,antd组件的样式会先显示默认的样式,然后再显示antd的样式,页面有一个跳跃的过程,体验非常差。 |
不引入 es 就好了呀,import { Button } from 'antd' |
原因是样式没插入。解决方案参考官网的样式抽取 https://ant-design.antgroup.com/docs/react/customize-theme-cn#%E6%9C%8D%E5%8A%A1%E7%AB%AF%E6%B8%B2%E6%9F%93 ,或者用 antd-style 一站式解决 |
+1 |
按照这个文档上的来的,把所有的css整体导出,还是没有解决闪烁问题,next13.4 antd 5.6.0 |
奇怪 我没 我没es引入也报错
移除ConfigProvider后 报相同的错误 |
|
@hengkx 没在钉钉群里? |
在 这个先发的 |
You publish an ES variant in the |
Reproduction link
http://www.baidu.com
Steps to reproduce
nextjs项目中:
报错:Cannot use import statement outside a module
What is expected?
不报错
What is actually happening?
报错:Cannot use import statement outside a module
The text was updated successfully, but these errors were encountered: