最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Angular 2+: Internet Explorer: Unable to get property 'call' of undefined or null reference - Stack

programmeradmin2浏览0评论

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 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);

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

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 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);

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

Share Improve this question edited Apr 18, 2018 at 20:44 BBaysinger asked Jun 13, 2017 at 20:36 BBaysingerBBaysinger 6,89714 gold badges77 silver badges146 bronze badges 10
  • You are getting a syntax error and undefined variables but are not sharing any code. – Raven Commented Jun 13, 2017 at 20:53
  • Hi BBaysinger , I was getting same error try to delete the package.lock.json and npm install againg , worked for me – Americo Arvani Commented Jun 20, 2017 at 15:16
  • Are you starting your app with "ng serve" ? Are you using any JQuery code? – Gambo Commented Jun 23, 2017 at 12:18
  • This could be one of a hundred problems. You might want to share a git repo since this is such a broad problem. As @AmericoArvani mentioned, it's likely to do with your npm installation or packages. – Z. Bagley Commented Jun 23, 2017 at 14:50
  • is it working in other browsers? – Robin Dijkhof Commented Jun 26, 2017 at 8:04
 |  Show 5 more ments

3 Answers 3

Reset to default 4

There could be a lot of problems here as mentioned in the ments but I recently had a problem with browser patibility and the solution was to use polyfills. Unment the following lines:

/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';

And run your application. It should be working down to IE10 at least it worked out for us. Based on the error message it is likely to work for You as well.

Try to load jQuery polyfills from assets:

in index.html's head:

  <script src="assets/...">

My take is to try at least https://plugins.jquery./webshims/

For anyone still running into this issue, try this:

Angular 2+: IE 11 Unable to get property 'call' of undefined or null reference

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.

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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论