bug 描述 [详细地描述 bug,让大家都能理解]
使用脚手架创建pro项目 没有任何修改,启动就报错
yarn create umi
* ant-desigin-pro
* javascript
TypeError: Cannot read property 'dispatch' of undefined
ConnectedRouter._this.handleLocationChange
node_modules/react-router-redux/es/ConnectedRouter.js:26
23 | }
24 |
25 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.handleLocationChange = function (location) {
> 26 | _this.store.dispatch({
| ^ 27 | type: LOCATION_CHANGE,
28 | payload: location
29 | });
View compiled
复现步骤 [清晰描述复现步骤,让别人也能看到问题]
期望结果 [描述你原本期望看到的结果]
复现代码 [提供可复现的代码,仓库,或线上示例]
版本信息:
其他信息 [如截图等其他信息可以贴在这里]
请写好你的 issue。并给出复现方法
I have the same issue. I ran the following commands:
`yarn create umi`
` Select the boilerplate type (Use arrow keys)
❯ ant-design-pro - Create project with an layout-only ant-design-pro boilerplate, use together with umi block.
app - Create project with a simple boilerplate, support typescript.
block - Create a umi block.
library - Create a library with umi.
plugin - Create a umi plugin.`
`yarn install`
`yarn start`
The page displays the loader and then throws the error mentioned by @beeant0512
What should I do to fix this?
我也遇到了相同的状况。应该是缓存出问题。
我神奇的解决方法: 把工程文件夹改了名称,start成功。成功了再改回来~ :(
我也遇到了相同的状况。应该是缓存出问题。
我神奇的解决方法: 把工程文件夹改了名称,start成功。成功了再改回来~ :(
Could you please explain the solution? I changed the project folder name to something else and ran the dev server. It still does not work.
I can't reproduce, try to reload dependencies?
I've noticed that the error occurs only when using VSCode on Windows. When using the system CMD, the dev server runs fine. Not sure why this is happening though.