Polyfill-service: Polyfill NodeList.prototype.forEach is not served in browser IE 11

Created on 24 May 2018  Â·  6Comments  Â·  Source: Financial-Times/polyfill-service

Just ran into this today:

v3.25.1 with an IE 11 detected does not serve the NodeList.prototype.forEach which has been added about a month ago.

Reproduce by taking a look at the output of:

curl -A "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko" https://cdn.polyfill.io/v2/polyfill.js

Most helpful comment

Wasn't familiar with the release process. I assumed v3.25.1 was the wrapping logic but actual polyfills were loaded dynamically.

Is there a good way to use the improvements in production right now? I know about self-hosting but I'd rather rely on the service to stay up-to-date later.

All 6 comments

v3.25.1 was released in January, so that's to be expected if NodeList.prototype.forEach was added a month ago.

Wasn't familiar with the release process. I assumed v3.25.1 was the wrapping logic but actual polyfills were loaded dynamically.

Is there a good way to use the improvements in production right now? I know about self-hosting but I'd rather rely on the service to stay up-to-date later.

So is there a solution or should I bite the bullet and convert NodeList to an Array?

[].slice.call(document.querySelectorAll("FOOBAR")).forEach(...);

Hi all, https://polyfill.io/v3 has this polyfill and serves it to Internet Explorer 11.

➜ curl "https://polyfill.io/v3/polyfill.js?features=NodeList.prototype.forEach&ua=ie/11"
/* Polyfill service v3.27.1
 * For detailed credits and licence information see https://github.com/financial-times/polyfill-service.
 * 
 * Features requested: NodeList.prototype.forEach
 * 
 * - NodeList.prototype.forEach, License: CC0 */

(function(undefined) {

// NodeList.prototype.forEach
NodeList.prototype.forEach = Array.prototype.forEach;})
.call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});

Please re-open this, I was posting this here because I am on v3. The downloaded file through IE11 does not include NodeList forEach, actually no NodeList matches are returned.

The URL used was: https://polyfill.io/v3/polyfill.js

Ping @JakeChampion

image

NodeList.prototype.forEach is not in the default set, the url you should be using is https://polyfill.io/v3/polyfill.js?features=default,NodeList.prototype.forEach. You are likely using the wrong url because the website isn't listing what is in the default set, you can follow #1861 if you want to know when the website is updated with the information about what is in the default set.

Was this page helpful?
0 / 5 - 0 ratings