Skip to content
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

🐛 [BUG]Cannot read property 'register' of undefined #10424

Open
ideaviewes opened this issue Dec 8, 2022 · 17 comments
Open

🐛 [BUG]Cannot read property 'register' of undefined #10424

ideaviewes opened this issue Dec 8, 2022 · 17 comments

Comments

@ideaviewes
Copy link

🐛 bug 描述

使用pro-cli创建的项目启动报错

📷 复现步骤 | Recurrence steps

pro create learn
选择umi@3
cd learn
tyarn
tyarn dev

🏞 期望结果 | Expected results

正常运行

💻 复现代码 | Recurrence code

直接报错
yarn run v1.22.5
$ npm run start:dev

ant-design-pro@5.2.0 start:dev E:\wandongli.com\admin.wandongli.com
cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev umi dev

Cannot read property 'register' of undefined
TypeError: Cannot read property 'register' of undefined
at service.pluginMethods. (E:\wandongli.com\admin.wandongli.com\node_modules@umijs\core\lib\Service\PluginAPI.js:181:12)
at inspectorPlugin (E:\wandongli.com\admin.wandongli.com\node_modules\react-dev-inspector\plugins\umi\react-inspector.js:48:95)
at E:\wandongli.com\admin.wandongli.com\node_modules@umijs\core\lib\Service\Service.js:364:29
at Generator.next ()
at asyncGeneratorStep (E:\wandongli.com\admin.wandongli.com\node_modules@umijs\core\lib\Service\Service.js:110:103) at _next (E:\wandongli.com\admin.wandongli.com\node_modules@umijs\core\lib\Service\Service.js:112:194)
at E:\wandongli.com\admin.wandongli.com\node_modules@umijs\core\lib\Service\Service.js:112:364
at new Promise ()
at E:\wandongli.com\admin.wandongli.com\node_modules@umijs\core\lib\Service\Service.js:112:97
at Service.applyAPI (E:\wandongli.com\admin.wandongli.com\node_modules@umijs\core\lib\Service\Service.js:371:7)
info 如果你需要进交流群,请访问 https://fb.umijs.org
Done in 5.77s.

© 版本信息

  • Ant Design Pro 版本: 5.2.0
  • umi 版本 3.5
  • 浏览器环境
  • 开发环境 win10
@burnjiaozhen
Copy link

我也有这个错误哎

@lwcmgowl
Copy link

lwcmgowl commented Dec 8, 2022

me too

@6201
Copy link

6201 commented Dec 8, 2022

我也遇到这个问题

@luoyepiaoling123
Copy link

是因为 react-dev-inspector 发布的最新版本 1.8.3 有问题,回退一个版本即可

@luoyepiaoling123
Copy link

我也遇到这个问题
react-dev-inspector 1.8.3 版本有问题,回退一下即可

@6201
Copy link

6201 commented Dec 8, 2022

react-dev-inspector回退后问题解决了

@nikvv
Copy link

nikvv commented Dec 9, 2022

I downgraded to "react-dev-inspector": "^1.7.0" but the same error still appears.

@anhao
Copy link

anhao commented Dec 9, 2022

    "react-dev-inspector": "^1.7.0",

也有这个问题
改成指定版本,1.8.2, 就1.8.3有这个问题
zthxxx/react-dev-inspector#137

@jellydong
Copy link

"react-dev-inspector": "1.8.1"
就OK了

@ideaviewes
Copy link
Author

感觉就跟没测试就扔到线上一样

@anhao
Copy link

anhao commented Dec 9, 2022

感觉就跟没测试就扔到线上一样

排查了一上午,到issues看原来是这个问题

@ideaviewes
Copy link
Author

感觉就跟没测试就扔到线上一样

排查了一上午,到issues看原来是这个问题

我是实在不想再浪费时间就用了umi4那个,那个没报错

@Even-Lau
Copy link

Even-Lau commented Dec 9, 2022

浪费了一个上午😢

@ideaviewes
Copy link
Author

有一次更恐怖的,我用Link的时候不小心引用了dumi中的link,开发的是没问题,传到服务器白屏
搞了三个小时才搞定,被骂的狗血淋头

@nikvv
Copy link

nikvv commented Dec 9, 2022

    "react-dev-inspector": "^1.7.0",

也有这个问题 改成指定版本,1.8.2, 就1.8.3有这个问题 zthxxx/react-dev-inspector#137

Same issue with ^1.8.2, looks like 'react-dev-inspector' is not the only cause of error.

Have been using react-dev-inspector: ^1.1.0 since the beginning.
Always works on build until today there was this error.

@zthxxx
Copy link
Contributor

zthxxx commented Dec 9, 2022

非常抱歉,发布了 react-dev-inspector@1.8.4 回滚到 1.8.1 的版本了

@nikvv sorry, react-dev-inspector has published 1.8.4 as a revert to 1.8.1

@nikvv
Copy link

nikvv commented Dec 9, 2022

非常抱歉,发布了 react-dev-inspector@1.8.4 回滚到 1.8.1 的版本了

@nikvv sorry, react-dev-inspector has published 1.8.4 as a revert to 1.8.1

I just updated to version 1.8.4 and the build worked, thank you for saving my weekend! also, thank you for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
10 participants