I have the same issue as this Object doesn't support property or method 'entries' and I installed the polyfill as one of the first scripts to run on my app.
This is the JS that has error
const formdata = new FormData(form);
for (var value of formdata.entries()) {
console.log(value);
}
Here Is the polyfill I am trying
if (!Object.entries) {
//this does not run on Edge. So Object.entries must exist
Object.entries = function( obj ){
var ownProps = Object.keys( obj ),
i = ownProps.length,
resArray = new Array(i); // preallocate the Array
while (i--)
resArray[i] = [ownProps[i], obj[ownProps[i]]];
return resArray;
};
}
The script as it is above does not run on Edge. So
Object.entries
must exist. So I tried the following.
Object.entries = function( obj ){
var ownProps = Object.keys( obj ),
i = ownProps.length,
resArray = new Array(i); // preallocate the Array
while (i--)
resArray[i] = [ownProps[i], obj[ownProps[i]]];
return resArray;
};
Now I know for sure that the script is on the page. but when I use
Object.entries
the error comes before the polyfill was used
How come the error runs instead of the polyfill on edge despite it definitely being on the page?