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

ie10和ie9下报错,导致页面无法渲染 #28

Closed
huiBuiling opened this issue Apr 12, 2019 · 14 comments
Closed

ie10和ie9下报错,导致页面无法渲染 #28

huiBuiling opened this issue Apr 12, 2019 · 14 comments
Labels
bug Something isn't working

Comments

@huiBuiling
Copy link

image

You should not use outside a

@huiBuiling
Copy link
Author

使用Switch正常,使用CacheSwitch就会报错,例子也是按demo写的

@CJY0208
Copy link
Owner

CJY0208 commented Apr 12, 2019

其他浏览器如 chrome 功能正常吗?能否提供可复现的最小 demo 片段呢

@huiBuiling
Copy link
Author

Edge和chrome都正常的
image

@CJY0208 CJY0208 added the bug Something isn't working label Apr 12, 2019
@CJY0208
Copy link
Owner

CJY0208 commented Apr 12, 2019

OK,感谢反馈!近期会尝试解决

@huiBuiling
Copy link
Author

好的,非常感谢

@CJY0208
Copy link
Owner

CJY0208 commented Apr 16, 2019

Hello,看来看去有些奇怪

<CacheSwitch> 的工作方式为继承 <Switch> 并重写了 render 方法,上述报错是出现在 <Switch> 的原有 render 方法中

按理来说,重写 render 方法后,使用 <CacheSwitch> 时无论如何都不应该出现上述报错才对

除非使用了旧版本的 <Switch>,报错并不是在其 render 方法中输出

我猜测可能是某种未知的兼容性问题,但缺乏更多有效的信息,能否提供完整的 Demo 目录呢?

可以加我 QQ:375564567 以压缩包形式提供,或者在此处张贴全部 Demo 代码

另外需要知晓 Demo 中的 reactreact-domreact-router 版本号,十分感谢!

@zxfgll
Copy link

zxfgll commented Apr 19, 2019

我也遇到这个问题,除了ie9和ie10有这个问题,其他现代浏览器都没有这个问题

@zxfgll
Copy link

zxfgll commented Apr 19, 2019

测试后"react-router-cache-route": "^1.4.1" 没问题,"react-router-cache-route": "^1.4.2"存在这个问题

@huiBuiling
Copy link
Author

huiBuiling commented Apr 22, 2019

image

"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-router": "^4.1.1",
"react-router-dom": "^4.1.1",
"react-router-cache-route": "^1.3.1",

edge下是可以的,之前也一直用的可以的,是后面突然不行的

@huiBuiling
Copy link
Author

@zxfgll 那我也测试下

@huiBuiling
Copy link
Author

@CJY0208 大大,这边删包重新install可以了,不确定是不是是版本,但是之前确实用了半年很赞,也没有报错哦

@CJY0208
Copy link
Owner

CJY0208 commented Apr 22, 2019

@huiBuiling @zxfgll

可能是 react-routerwithRouter 在 ie9 / ie10 下有什么暗病,如果目前降版本能用的话,就先用着啦,最近忙业务一直没时间看

因为 1.4.2 是为了兼容 react-router v4.4+ 的修复版本,如果项目中 react-router 版本没有达到 4.4 的话,是不需要升级到 1.4.2

这条 issues 先保持开启吧,后续尝试能否无感知修复掉,正好也做个解法标记,谢谢你们啦

@huiBuiling
Copy link
Author

好的

@CJY0208
Copy link
Owner

CJY0208 commented May 16, 2019

@huiBuiling @zxfgll
v1.4.3 尝试识别 router-router v4.4+ 特征来决定是否使用 withRouter 包裹 CacheSwitch 组件,在版本低于 4.4 时不会使用 withRouter

可以试试看,是否修复了当前 Issues

@CJY0208 CJY0208 closed this as completed Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants