获取SCRIPT5022:区域中的安全错误.js (192,25)



当我在IE11上的iframe中加载Angular组件时,我断断续续地SCRIPT5022: SecurityError in zone.js (192,25)

除此之外,框架正在工作,我没有注意到任何损坏。

这是围绕错误的代码:

try {
return this._zoneDelegate.invokeTask(this, task, applyThis, applyArgs);
}
catch (error) {
if (this._zoneDelegate.handleError(this, error)) {
line 192:           throw error;
}
}

有谁知道导致此错误的原因?我还在 github 上发现了这个问题,它看起来是一样的 - https://github.com/angular/zone.js/issues/1001。

我使用 uberspeck 的解决方案修复了它,将以下 2 行代码添加到我的 polyfills.ts 文件中。

import 'core-js/es7/object';
import 'core-js/es7/array';

尝试将此脚本添加到索引中.html

<script>
__Zone_enable_cross_context_check = true;
</script>

最新更新