-
Notifications
You must be signed in to change notification settings - Fork 325
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
汇总:react-router、history 更新引起的相关问题及解决方案 #82
Labels
Comments
This was referenced Mar 18, 2019
Closed
Closed
hanwenbo
added a commit
to mojisrc/fashop-admin
that referenced
this issue
Mar 23, 2019
感谢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cannot read property 'Consumer' of undefined
原因
使用的 react-router 和 react-router-dom 版本不同,通常出现在 ant-design-pro 的用户中,因为 ant-design-pro 手动依赖了一个
react-router-dom@^4.3.1
,^
前缀引让 npm/yarn 下载依赖时匹配到 react-router@4.4。解决
方法一(别这么干)
修改 package.json 中 react-router-dom 的依赖为 4.3.1。能解决问题,但治标不治本,下次 umi 把 react-router 升级到 4.4,就又挂了。
方法二(推荐)
参考 ant-design-pro!3787 修复,删除 react-router-dom 依赖,路由功能全部走 umi。
Module not found: Can't resolve '@babel/runtime/helpers/...'
原因
history 发布了 4.9,而 roadhog 之前版本对于
@babel/runtime
的处理不恰当。解决
方法一
新建 webpack.config.js,内容如下:
方法二
roadhog 依赖升级为
^2.5.0-beta.4
。The text was updated successfully, but these errors were encountered: