umijs / umi

A framework in react community ✨
https://umijs.org
MIT License
15.39k stars 2.65k forks source link

[Bug] 升级umi至3.5.0-beta.8开启mfsu出错 #6764

Closed ISBN9527 closed 3 years ago

ISBN9527 commented 3 years ago

What happens?

升级umi至3.5.0-beta.8开启mfsu出错 在antd-pro使用mfsu

  1. 升级umi从3.4.25-->3.5.0-beta.8
  2. 使用的是antd-pro,根据umi官方配置,在config.ts配置如步骤3
  3. mfsu: { includes: [ 'rc-util/es/hooks/useMergedState', 'swagger-ui-react', 'moment', 'moment/locale/*', 'events', 'lodash', '@ant-design/pro-layout/es/PageLoading', 'antd/es/locale/*', 'querystring', ], redirect: { '@umijs/plugin-request/lib/ui': { message: 'antd', notification: 'antd', }, }, },

报错日志

Validate config "mfsu" failed, "includes" is not allowed

还是在antd-pro,如果直接开启mfsu:{}会报如下错误

image

Context

sorrycc commented 3 years ago
  1. includes 和 redirect 删了,不需要了
  2. node_modules/@umijs 下有 runtime 目录吗?
  3. 用的啥包管理工具?
ISBN9527 commented 3 years ago

直接配置mfsu:{},安装@umijs/runtime后还是报错,用的yarn

sorrycc commented 3 years ago

没解答第二个问题,另外给个复现?

ISBN9527 commented 3 years ago

node_modules/@umijs没有runtime目录

ISBN9527 commented 3 years ago

复现地址https://github.com/ISBN9527/test

xiefengnian commented 3 years ago

复现地址https://github.com/ISBN9527/test

我拉下来跑了一下,没有出错,建议删除 node_modules 和 .umi 后重试

sorrycc commented 3 years ago

@ISBN9527 yarn -v 看下是啥?

ISBN9527 commented 3 years ago

yarn -v // output 1.22.10

sorrycc commented 3 years ago

yarn.lock 贴出来看下?

ISBN9527 commented 3 years ago

太大了,贴不出来

ISBN9527 commented 3 years ago

好了,复现地址里就有yarn.lock

ISBN9527 commented 3 years ago

复现地址https://github.com/ISBN9527/test

我拉下来跑了一下,没有出错,建议删除 node_modules 和 .umi 后重试

在升级之前项目运行是ok的,删除node_modules及.umi后能跑起来了,但是项目页面出不来

sorrycc commented 3 years ago

复现了。

sorrycc commented 3 years ago
ISBN9527 commented 3 years ago

收到

ISBN9527 commented 3 years ago

image @sorrycc 升级后退出到首页报这样的错

sorrycc commented 3 years ago

看起来是 dayjs 插件的问题。

ISBN9527 commented 3 years ago

确实是antd-dayjs-webpack-plugin和dayjs插件引起的,删了这两个就好了

ISBN9527 commented 3 years ago

image 疑问

  1. 为啥那么多warning呢
sorrycc commented 3 years ago

umi 啥版本?beta.9 应该没这个了吧,依赖编译不生成 sourcemap。

ISBN9527 commented 3 years ago

确实是beta.9

xiefengnian commented 3 years ago

image 疑问

  1. 为啥那么多warning呢

看起来是因为 map 文件没有找到,导致返回了 html,建议删了 .umi,重新启动一下

ISBN9527 commented 3 years ago

怎么删除都没用,都会出现这一堆warning