P
P
Pipop2020-08-11 18:14:06
JavaScript
Pipop, 2020-08-11 18:14:06

Why doesn't babel-polyfill transpile forEach for NodeList?

Throws an error in IE when I try to use forEach on a NodeList or just the closest method. In theory, the polyfill should treat this out of the box, perhaps it's a wrong connection?

In the webpack config is:

module.exports = {
    mode: 'development',
    entry: ['@babel/polyfill',  './src/App.js'],
    output: {
        filename: 'bundle.js',
        path: path.resolve(__dirname, 'dist')
    },
   ...
}


5f32b5e166a81117194799.png
5f32b76507918594388215.png

PS With this configuration, Object.assign works. Do I need to install additional polyfills besides babel-polyfill? Shouldn't the first one patch holes like this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question