-
Notifications
You must be signed in to change notification settings - Fork 30
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
使用 antd pro 官方脚手架,mfsu 报错! #66
Comments
解决了吗 |
你也遇到了吗? |
对的 |
目前没解决。还是用的Moment,但用了umi的 ignoreMomentLocale |
排查结果debug后发现是执行isMoment报错猜测是不存在isMoment手动导入isMoment插件发现报了这个错误
我猜测mfsu不支持require导入,而这个转换插件正是以require的方式去引入所需要的插件,导致moment需要执行的方法都没有extend进去。antd-dayjs-webpack-plugin/src/init-loader.js Lines 6 to 12 in 32951b4
解决方案如下手动导入moment需要转换的插件: antd-dayjs-webpack-plugin/src/index.js Lines 5 to 18 in 32951b4
导入方式: import isMoment from 'dayjs/esm/plugin/isMoment';
dayjs.extend(isMoment as any); 暂时还不知道怎么以webpack插件的方式去修复这个问题 |
Cache group "default" conflicts with existing chunk. |
我也排查了一下, 简单地说, 是开了msfu 之后, 用到的那部分代码不在
因为开 msfu之前, antd都打包到 umi里面了, 所以 import Moment from 'dayjs', 之后改动 Moment 其实改得是同一个, |
@Dunqing 你的可以了吗?我引入以后日历全变成相同的数了 |
我在config设置了 dayjs.extend(isMoment as any); |
使用脚手架 getting-started 生成代码运行报错,内容如下:
初步排查,当
config/config.ts
开启 umi 的mfsu: {}
功能, 且使用@ant-design/pro-form
(src/pages/user/Login/index.tsx) 就会出现问题。demo: create-antd-pro
The text was updated successfully, but these errors were encountered: