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.

Map polyfill fails (in certain use cases?) on IE11 using default-3.4 or newer

See original GitHub issue

Using IE11 (11.1884.14393.0) and polyfill service 3.24, the polyfill string default-3.6,Map will fail (telling me Object doesn't support property or method 'entries', polyfill.js 434:3). However, default-3.3,Map works just fine; as does default-3.6 without added bonuses, but this seems fully dependent on the use case. Adding Map to any default-version from 3.4 and above will fail. The failing block in question looks like this:

	Map.prototype['forEach'] = function(callbackFn, thisArg) {
		thisArg = thisArg || global;
		var iterator = this.entries(); // <- Right here!
		var result = iterator.next();
		while (result.done === false) {
			callbackFn.call(thisArg, result.value[1], result.value[0], this);
			result = iterator.next();
		}
	};

Polyfill header:

/* Polyfill service v3.24.0
 * For detailed credits and licence information see https://github.com/financial-times/polyfill-service.
 * 
 * UA detected: ie/11.0.0
 * Features requested: Map,default-3.6

Now, I know that Map is already included in default-3.6, but in certain cases that fails as well, without clear indication of what’s gone wrong. default-3.6,fetch fails for one of our sites inside the Map-polyfill on IE11 with the message Unable to get property 'get' of undefined or null reference (polyfill.js 1303,3), here:

	var isMap;
	if (hasMap) {
		var mapSize = Object.getOwnPropertyDescriptor(Map.prototype, 'size').get; // Here!
		isMap = function (m) {
			try {
				mapSize.call(m);
				return true;
			} catch (e) {
				return false;
			}
		};
	}

Polyfill header for that one:

/* Polyfill service v3.24.0
 * For detailed credits and licence information see https://github.com/financial-times/polyfill-service.
 * 
 * UA detected: ie/11.0.0
 * Features requested: default-3.6,fetch

That’s about all the detail I can give you presently. Any idea of how to fix this?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16

github_iconTop GitHub Comments

4reactions
sanderwapstracommented, Jan 25, 2018

Same problem here with Google Maps and IE11, when adding Array.from to the features list.

0reactions
JakeChampioncommented, Feb 21, 2019

This looks to be fixed in v3 of polyfill.io. I tested all the jsbin links in this thread and none of them are throwing errors 😃

bs_win10_ie_11 0 3

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Maps compatibility IE11 not working because of ...
This will load the Google Maps script after the main JS for the application is loaded. I don't use Angular but a similar...
Read more >
Maps JavaScript API Release Notes - Google Developers
Beta channel: Introduces the Place class, a new simpler API supporting modern usage patterns such as Promises. The Place class includes some new...
Read more >
babel/preset-env
By default, only polyfills for stable ECMAScript features are injected: if you want to polyfill proposals, you have three different options: when using...
Read more >
Fix site display issues with Compatibility View in Internet ...
Learn how to fix website display problems using Compatibility View in Internet Explorer. ... Support for Internet Explorer 11 has ended on June...
Read more >
Issues and Pitfalls - Draft.js
This article addresses some known issues with the Draft editor framework, ... a handful of CSS resources intended for use with the editor, ......
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