Angular 2+:Internet Explorer:无法获取未定义或空引用的属性“调用" [英] Angular 2+: Internet Explorer: Unable to get property 'call' of undefined or null reference

查看:46
本文介绍了Angular 2+:Internet Explorer:无法获取未定义或空引用的属性“调用"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Angular 4.2.4 (Angular-CLI 1.1.3)、IE11 中,我得到 SCRIPT1002: Syntax errorSCRIPT5007: Unable to get property 'call' of undefined or null reference.我有我的 polyfill,我会假设 Webpack 和 Angular-CLI 会完成剩下的工作.我在这里错过了什么?

In Angular 4.2.4 (Angular-CLI 1.1.3), IE11 I get SCRIPT1002: Syntax error and SCRIPT5007: Unable to get property 'call' of undefined or null reference. I have my polyfills in and I would have assumed that Webpack and Angular-CLI would have done the rest. What am I missing here?

Unable to get property 'call' of undefined or null reference 在它后面说:bootstrap 50034e0a1f93dabcb117 (54, 1) 没有任何真实文件名的指示.而 Syntax error 说它在 vendor.bundle.js (63117,26) 中,看起来像:

Unable to get property 'call' of undefined or null reference says after it: bootstrap 50034e0a1f93dabcb117 (54, 1) with no indication of a real filename. And Syntax error says it's in vendor.bundle.js (63117,26), which looks like:

window.setTimeout(() => {
    window.removeEventListener('click', suppressClick, true);
}, 0);

更新:之前对我来说应该更明显,但这看起来像 ES6 代码,它应该编译成 ES5.

Update: Should have been more obvious to me before, but this looks like ES6 code, and it should be compiling down to ES5.

推荐答案

对于仍然遇到此问题的任何人,请尝试以下操作:

For anyone still running into this issue, try this:

Angular2+:IE 11 无法获取未定义或空引用的属性调用"

如果您遇到的错误发生在如下所示的一大段代码上:

If the error you're getting occurs on a hunk of code that looks like this:

window.setTimeout(() => {
    window.removeEventListener('click', suppressClick, true);
}, 0);

...然后请告诉我该解决方案是否有效.我会更新这个答案,并可能将此问题标记为重复.

...then please let me know if the solution worked or not. I will update this answer, and possibly mark this question as duplicate.

我不认为这些是同一个问题,因为错误发生在 bundle.js 中的不同代码上.有人对这个答案投了反对票,但没有给出任何关于这些问题是否有相同解决方案的反馈.

I DO NOT BELIEVE THESE TO BE THE SAME ISSUE AT THIS TIME, AS THE ERRORS OCCURRED ON DIFFERENT CODE IN bundle.js. Someone voted this answer down, without giving any feedback on whether or not these questions have the same solution.

我目前没有办法对此进行测试,但想将人们引向可能的解决方案.

I do not have a way to test this currently, but wanted to direct folks to a possible solution.

这篇关于Angular 2+:Internet Explorer:无法获取未定义或空引用的属性“调用"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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