umijs / umi

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

[Bug] MFSU -- antdPro 开启MFSU就报错 #6778

Closed chengluliu closed 3 years ago

chengluliu commented 3 years ago

在 config.ts 中 开启 mfsu: {}, 之后 编译成功 页面报错, 关掉之后可以正常显示

复现仓库 https://github.com/chengluliu/mfsu_error.git

xiefengnian commented 3 years ago

windows or mac?

chengluliu commented 3 years ago

@xiefengnian Mac

xiaohuoni commented 3 years ago

我看下

xiaohuoni commented 3 years ago

react-dev-inspector 的 Inspector 不兼容。

https://github.com/ant-design/ant-design-pro/blob/09ca467444dea9415f15d2859f41a9b231a4e01d/src/layouts/BlankLayout.tsx#L7

xiaohuoni commented 3 years ago

原因是 react-dev-inspector 的入口是按以下方式组织的。 package.json

  "main": "es/index.js",
  "module": "es/index.js",
  "types": "es/index.d.ts",

es/index.js

export * from './Inspector';

es/Inspector.js

export const Inspector = ()=>{}

image 尝试改了一下导出如下:

  "main": "es/Inspector.js",
  "module": "es/Inspector.js",
  "types": "es/Inspector.d.ts",

项目可以正常运行。 然后这东西怎么修,不知道!@sorrycc

sorrycc commented 3 years ago

这个修复了。