react-keeper icon indicating copy to clipboard operation
react-keeper copied to clipboard

IE 下 对象不支持“subscribe”属性或方法

Open XiaoBaiRoadToGod opened this issue 8 years ago • 7 comments

RouteBase.js里边 image

XiaoBaiRoadToGod avatar Jan 06 '18 07:01 XiaoBaiRoadToGod

IE几?

lanistor avatar Jan 06 '18 14:01 lanistor

@vifird IE10

XiaoBaiRoadToGod avatar Jan 07 '18 06:01 XiaoBaiRoadToGod

Solve Step

  1. clone the code and add to my project
  2. run npm install --save-dev babel-plugin-transform-proto-to-assign
  3. add "transform-proto-to-assign" in babelrc's plugin.

Here is the Reference found in react-router issue#1779. This seemed like the bug happened in babel for compiling static for IE support under 10. You can find caveats in this page in the end of article.

Bug Exist

After first render, seems the component disappeared, happen in IE<=10

dogbutcat avatar Apr 20 '18 01:04 dogbutcat

RouteBase.js?31c9:73 Uncaught TypeError: _this.context.subscribe is not a function at RouteBase (RouteBase.js?31c9:73) at Route._class (RouteIndex.js?848b:32) at Route._class (RouteFilter.js?e8f9:40) at Route._class (RouteRedirect.js?4eb4:34) at Route._class (RouteCache.js?1e88:46) at Route._class2 (RouteMiss.js?84ff:40) at new Route (Route.js?f902:49) at roadhog.dll.js:36 at s (roadhog.dll.js:36) at p._constructComponentWithoutOwner (roadhog.dll.js:36) google浏览器也有同样的问题,替换的dva的route

cendy-z avatar Oct 11 '18 12:10 cendy-z

@cendy-z 可以按照dogbutcat同学的方式尝试下

lanistor avatar Oct 14 '18 03:10 lanistor

@cendy-z 解决了吗,我也出现了这问题

zhaozilong123 avatar Dec 24 '18 09:12 zhaozilong123

IE11以下不支持__proto__,可以通过npm方式引入React-Keeper,然后使用transform-proto-to-assign转义__proto__来解决此问题。

lanistor avatar Dec 26 '18 08:12 lanistor