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

ie11下报SCRIPT5022引发了但未捕获异常错误 #1807

Closed
jack-hate-titanic opened this issue Jul 12, 2018 · 6 comments
Closed

ie11下报SCRIPT5022引发了但未捕获异常错误 #1807

jack-hate-titanic opened this issue Jul 12, 2018 · 6 comments

Comments

@jack-hate-titanic
Copy link

jack-hate-titanic commented Jul 12, 2018

1.开发环境在ie11下没有问题,部署以后在ie11下就出现这种问题

2222
点击script5022,
3331

点击对应代码
4444
ie11一直空白出不来,请问是什么问题

@sorrycc

@zjsth92
Copy link

zjsth92 commented Jul 15, 2018

相关issues

错误提示
roadhog dev 下一切正常, COMPRESS=none roadhog build 编译后出错

React.Children.only expected to receive a single React element child
The above error occurred in the <Provider> component:
                   in Provider (created by DvaRoot)
                   in DvaRoot

尝试解决方案

  1. 正确在index.js 第一行引入 import '@babel/polyfill' 任然报错
  2. 使用COMPRESS=none编译依然报错
  3. roadhog 已经是最新版本2.4.2

@sorrycc

@zjsth92
Copy link

zjsth92 commented Jul 15, 2018

@Y-wson roadhog 切换到2.4.1试一下, 我的版本降级后就没问题了

@zjsth92
Copy link

zjsth92 commented Jul 18, 2018

@sorrycc 初步判断问题来自这行. 只要将 NODE_ENV 设置为 production 就出错

@zjsth92
Copy link

zjsth92 commented Jul 18, 2018

一年前的Issue #662
看起来像是这个 facebook/react#8379

@zjsth92
Copy link

zjsth92 commented Jul 18, 2018

原因已找到

就是这个 facebook/react#8379
react 在 IE11 中需要对 Symbol 提供 polyfill。但是由于我是通过 CDN导入react, 所以在index.js第一行 import '@babel/polyfill' 会导致polyfill 在react之后运行。

@sorrycc 但是不清楚为何将 NODE_ENV 设为 production 会导致这个问题。

@sorrycc sorrycc closed this as completed Jul 18, 2018
@yoyo837
Copy link

yoyo837 commented Sep 4, 2018

把你的@babel/polyfill也改为cdn的吧

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

No branches or pull requests

4 participants