IE中未定义“代理” [英] 'Proxy' is undefined in IE

查看:353
本文介绍了IE中未定义“代理”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过React + Node +



有人知道


  1. 如何解决此问题?

  2. 我怎么知道哪个库/部件我的代码使用此 Proxy ?我可以用其他方式代替它。

编辑1: .umirc中。 ts

  treeShaking:是,
目标:{
即: 9,
Safari:9,
},

package.json

  umi: ^ 2.7.0,
umi-plugin-react: ^ 1.8.0,
umi-types: ^ 0.2.0

编辑2:



我尝试了 yarn添加proxy-polyfill ,然后纱线开始。奇怪的是,它在本地主机无效字符'umi'未定义



解决方案

缺少一个polyfill。您是否检查了umi.js的此配置? https://umijs.org/config/#targets



将ie的目标设置为11(如上面的链接)应该可以添加所需的polyfill。

 目标:{
即:11,
...其他浏览器
},
...其余的配置

LE:



如果umi.js存在问题,您可以尝试添加自己需要填充(例如,这里是代理 https://github.com/GoogleChrome/proxy-polyfill


I have built an Excel add-in by React+Node+Umi. We have implemented our authentication system. The authentication works in Chrome and Safari, I just realized that it does not work well in IE11; F12 shows that 'Proxy' is undefined.

Although it is an Excel add-in, we could reproduce the error (and the same error message) just in browser. Open the link https://jsaddin.10studio.tech/welcome/?next=formulaEditor in IE 11, sign in with ID 3094557608@qq.com and password: 123456. We could see the error message in F12.

Does anyone know

  1. how to fix this?
  2. how could I know which library/part of my code uses this Proxy? I may replace it by alternatives.

Edit 1: In .umirc.ts:

treeShaking: true,
targets: {
  ie: 9,
  safari: 9,
},

In package.json:

"umi": "^2.7.0",
"umi-plugin-react": "^1.8.0",
"umi-types": "^0.2.0"

Edit 2:

I tried yarn add proxy-polyfill, then yarn start. Curiously, it raised an error in localhost Invalid character and 'umi' is undefined:

解决方案

It looks like you are missing a polyfill. Did you check this config for umi.js? https://umijs.org/config/#targets

Setting the target of ie to 11 (as in the above link) should handle adding the polyfills you need.

  targets: {
    ie: 11,
    ...other browsers
  },
  ...rest of the config

LE:

In case there is an issue with umi.js you can try adding the needed polyfills yourself (e.g. here is one for Proxy https://github.com/GoogleChrome/proxy-polyfill)

这篇关于IE中未定义“代理”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆