我通过 React+Node+ 构建了一个 Excel 插件Umi https://umijs.org/。我们已经实施了我们的身份验证系统。身份验证在 Chrome 和 Safari 中有效,我刚刚意识到它在 IE11 中不能很好地工作;F12
表明'Proxy' is undefined
.
尽管它是一个 Excel 加载项,但我们可以仅在浏览器中重现该错误(以及相同的错误消息)。打开链接https://jsaddin.10studio.tech/welcome/?next=formulaEditor https://jsaddin.10studio.tech/welcome/?next=formulaEditor在 IE 11 中,使用 ID 登录[email protected] /cdn-cgi/l/email-protection
和密码:123456
。我们可以在F12中看到错误消息。
有人知道吗
- 如何解决这个问题?
- 我怎么知道我的代码的哪个库/部分使用了这个
Proxy
?我可以用替代品代替它。
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
。奇怪的是,它在 localhost 中引发了一个错误Invalid character
and 'umi' is undefined
:
看起来你缺少一个polyfill。你检查过 umi.js 的配置吗?https://umijs.org/config/#targets https://umijs.org/config/#targets
将 ie 的目标设置为 11(如上面的链接所示)应该可以添加您需要的填充。
targets: {
ie: 11,
...other browsers
},
...rest of the config
LE:
如果 umi.js 出现问题,您可以尝试自己添加所需的 polyfill(例如,这里是 Proxyhttps://github.com/GoogleChrome/proxy-polyfill https://github.com/GoogleChrome/proxy-polyfill)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)