paulmillr / es6-shim

ECMAScript 6 compatibility shims for legacy JS engines
http://paulmillr.com
MIT License
3.11k stars 387 forks source link

TypeError: Object doesn't support property or method 'next' in IE browser #461

Open malicansoundar opened 4 years ago

malicansoundar commented 4 years ago

When we try to play video content in IE we are getting the below error. Can someone help me to close this issue? issue-shim-git

ljharb commented 4 years ago

Can you share the code at line 438 in ima3.js, where it's presumably calling Array.from?

Even better, could you use the debugger or console.log and figure out exactly what arguments are being passed to it?

malicansoundar commented 4 years ago

Hi @ljharb,

Thank you. I debugged the code as suggested and found the below line is causing the issue in ima3.js

bw = function () { var a = (window.location.origin || "null").trim(), b = "null" === a, c = window == window.top, d = !1; try { d = null != window.top.location.hostname; } catch (f) { } var e = null != Array.from(document.body.getElementsByTagName("script")).find(function (f) { return f.src && f.src.includes("connatix"); }); Ps.B().report(121, { location: Pv(), top_origin: Qv(), origin: a, is_null: b, is_top: c, is_friendly_to_top: d, is_vpaid_adapter: W.zb(), is_connatix_player: e }); };

malicansoundar commented 4 years ago

Could you please help us in resolving this? We have a production bug regarding this and our application has failed to launch.

ljharb commented 4 years ago

Specifically it looks like Array.from(document.body.getElementsByTagName("script")); can you confirm that running that code in the console reproduces the same error?

Which version of IE is this? It works fine for me in IE 10 and 11 on the es6-shim test page, for example.

Are you sure you're not loading any other polyfills, like babel-runtime/core-js?

malicansoundar commented 4 years ago

can you confirm that running that code in the console reproduces the same error? - Yes, we are getting the same error when we use it in the console log.

Which version of IE is this? - IE11

Are you sure you're not loading any other polyfills, like babel-runtime/core-js? Yes, we are using the below dev dependency. So that it will automatically add babel-runtime/core-js.

Please help us with what has to do?

"@uirouter/angularjs": "^0.2.18", "angular": "~1.5.0", "angular-animate": "~1.5.0", "angular-cookies": "~1.5.0", "angular-messages": "~1.5.0", "angular-resource": "~1.5.0", "angular-route": "~1.5.0", "angular-sanitize": "~1.5.0", "angular-socialshare": "^2.3.11", "angular-timer": "^1.3.4", "angular-touch": "~1.5.0", "es6-shim": "^0.35.1", "humanize-duration": "^3.20.1", "jquery": "^3.4.1", "moment-timezone": "^0.5.11", "ng-device-detector": "^3.0.1", "re-tree": "^0.1.7", "slick-carousel": "~1.4.1", "underscore": "^1.9.1"

malicansoundar commented 4 years ago

Can we add polyfill for this issue?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Polyfill

ljharb commented 4 years ago

core-js and es6-shim are never intended to be used together; they do the same things. If you can’t avoid using babel-runtime, you’ll need to use a bundler to omit core-js if you want to use es6-shim.

ljharb commented 4 years ago

The polyfills on MDN are not production quality and should never be used.

adhavanUI commented 4 years ago

Can you please share any helpful document or link to create bundler for omit core-js in angular

ljharb commented 4 years ago

It depends on what bundler you're using; webpack and browserify each have their own docs and tutorials all over the web.

Typically only the top-level app would be pulling in core-js or es6-shim tho; are you sure your own code isn't doing it?