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.

IE11 bug with Symbols and Enumerables exposed by lodash.omit

See original GitHub issue

Bountysource

I’ve been trying to track this one down for a while now, and though I know where the failure is, it isn’t clear as to the best resolution.

Here is an isolated codepen that demonstrates that when poly+lodash+IE11 is combined, will blow up with:

"TypeError: Unable to get property '@@__symbol:iterator0.0365778717409362961' of undefined or null reference
   at propertyIsEnumerable (https://cdn.polyfill.io/v2/polyfill.js?features=default,Array.prototype.@@iterator:244:3)
   at Anonymous function (https://cdn.jsdelivr.net/lodash/4.17.4/lodash.js:6056:9)
   at arrayFilter (https://cdn.jsdelivr.net/lodash/4.17.4/lodash.js:603:7)
   at Anonymous function (https://cdn.jsdelivr.net/lodash/4.17.4/lodash.js:6055:7)
   at Anonymous function (https://cdn.jsdelivr.net/lodash/4.17.4/lodash.js:6070:9)
   at baseGetAllKeys (https://cdn.jsdelivr.net/lodash/4.17.4/lodash.js:3064:7)
   at getAllKeysIn (https://cdn.jsdelivr.net/lodash/4.17.4/lodash.js:5903:7)
   at Anonymous function (https://cdn.jsdelivr.net/lodash/4.17.4/lodash.js:13485:7)
   at apply (https://cdn.jsdelivr.net/lodash/4.17.4/lodash.js:496:15)
   at Anonymous function (https://cdn.jsdelivr.net/lodash/4.17.4/lodash.js:6600:9)"

http://codepen.io/asilvas/pen/VPaOjz

Deps:

This is the line of the failure: https://github.com/Financial-Times/polyfill-service/blob/master/polyfills/Symbol/polyfill.js#L84

Where this[internalSymbol]['@@' + uid] assumes that this[internalSymbol] is always defined, but is not the case. Of course, might just be able to add a conditional and be done with it, but appears this code behaves this way for a reason. So I’m guessing a resolution is needed elsewhere.

I’ve also been able to force this error (by overriding native polyfills) in other browsers like Chrome, but the codepen won’t do that in its current form.

What appears to be a near identical issue was found before with core-js in reference to lodash: https://github.com/lodash/lodash/issues/2308

Which was supposedly fixed. It’s not clear if that fix could somehow help in addressing this.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
rhalukongorcommented, Feb 22, 2017

It seems this bug also effects Safari versions < 9. I also want to give it a try. This is hitting us pretty badly.

3reactions
joeldenningcommented, Jan 19, 2017

I have run into this issue as well. What seems to be happening is that lodash calls Object.prototype.propertyIsEnumerable. However, polyfill-service’s implementation of propertyIsEnumerable seems to be incorrect for polyfilled Symbols. The polyfill-service implementation returns true for symbol properties, even if they were defined with {enumerable: false}, which seems to be a bug.

Note that this bug affects any code that uses Object.prototype.propertyIsEnumerable when in combination with the Array.prototype.@@iterator polyfill-service. I am still not sure exactly how propertyIsEnumerable is returning true for the iterator symbol on the Array prototype, but that’s what I think is happening.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IE11 bug with Symbols and Enumerables exposed by lodash.omit
IE11 bug with Symbols and Enumerables exposed by lodash.omit. ... Here is an isolated codepen that demonstrates that when poly+lodash+IE11 is combined, ...
Read more >
share/swagger-ui.js.map - metacpan.org
node_modules/core-js/library/modules/_enum-bug-keys.js","webpack://SwaggerUICore/. ... node_modules/lodash/omit.js","webpack://SwaggerUICore/external ...
Read more >
vue-server-renderer | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
BIG-IP 15.1.2.1 Fixes and Known Issues - AskF5 - F5 Networks
Impact: The previous Logging Profiles are not disassociated from the virtual server. Workaround: Perform each Log Profile change individually. For example, to ...
Read more >
converse.js at [b24370a6e5] - Keyframe
forEach` for arrays without support for * iteratee shorthands. ... and `symbolsFunc` to get the enumerable property names and * symbols of `object`....
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