question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A call to the setDescriptor function fails in IE11.

See original GitHub issue

Bug

What

A call to the setDescriptor function fails in IE11.

Details

In IE11 (user-agent: ‘Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko’), under certain circumstances (reasons not known), the ‘protoDescriptor’ variable in the setDescriptor function (line 4842) is undefined. This means the call to objectDefineProperty fails.

The solution is to change code as follows:

setDescriptor = function (o, key, descriptor) {
  var protoDescriptor = gOPD(ObjectProto, key);
  delete ObjectProto[key];
  objectDefineProperty(o, key, descriptor);
  if (o !== ObjectProto) {
    objectDefineProperty(ObjectProto, key, protoDescriptor);
  }
};

to:

setDescriptor = function (o, key, descriptor) {
  var protoDescriptor = gOPD(ObjectProto, key);
  delete ObjectProto[key];
  objectDefineProperty(o, key, descriptor);
  if (o !== ObjectProto && protoDescriptor !== undefined) {
    objectDefineProperty(ObjectProto, key, protoDescriptor);
  }
};

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
RaParkercommented, Aug 22, 2021

Yes. Sorry, I’ve meant to get back to you for a week now.

So, it turned out there were two polyfills running: core-js and this one. The problem is that for IE11, core-js doesn’t provide nearly enough polyfilling. I did try manually creating an extract of the missing prototype definitions, copied directly from your library, but once these errors were resolved, some obscure errors remained. So for the time being, I’ve resigned myself to running two polyfills for ie11 alone, but applying the manual fix I described in the initial bug report. It’s far from an ideal scenario, but it does work, so I’m going with that.

On Sun, 22 Aug 2021 at 08:38, Romain Menke @.***> wrote:

@RaParker https://github.com/RaParker did you find anything interesting?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Financial-Times/polyfill-library/issues/1072#issuecomment-903227533, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELRFYR557W7AY3BINOOUSLT6CSO3ANCNFSM5AVZ5TCA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

0reactions
JakeChampioncommented, Aug 22, 2021

Thanks for looking into this both of you. That Babel plugin looks great!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google recaptcha error in ie 11 - Stack Overflow
It works with IE, but Chrome return an error : document.querySelector(...).setActive is not a function . See my answer. – Matthieu Charbonnier.
Read more >
Script errors in Internet Explorer - Browsers - Microsoft Learn
A script error occurs in Internet Explorer, the webpage cannot be displayed correctly and you receive an error message.
Read more >
Javascript code not working in IE11
Your .success function has 338 lines of code, ... o[f] = function () { try { var args = slice.call(arguments); args.unshift(new Date().
Read more >
Debug JavaScript in Internet Explorer 11 in 7 easy steps
Need to debug JavaScript in Internet Explorer? Simply follow these 7 steps. Includes examples. Read our debugging guide today.
Read more >
Calling external API not working in IE 11 - Microsoft Dynamics ...
Calling external API not working in IE 11 ... I am using an external API to call data using JavaScript and i am...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found