As found on the official documentation IE11 does not support FormData
at all or at least not much enough I need to.
Inside my code I have to loop through the entries of an FormData
element. For this task I use the entries()
function which is not working on IE giving me the error
Object doesn't support property or method 'entries'
I already added https://github.com/jimmywarting/FormData via npm to my project and added it to my entry in webpack.config.js
which then looked something like this.
const webpack = require("webpack");
const path = require("path");
module.exports = {
entry: {
app: ["babel-polyfill", "formdata-polyfill", "whatwg-fetch", "./Scripts/Modules/index.ts"]
},
}
In the console I can see that formdata.min.js
is loaded. As the error still occurs it seems like it does not use the polyfill as it should. It still uses the default one which fails.
How can I tell my TypeScript
code to use the polyfill-version instead of the browser's default implementation as the package does not provied any d.ts
files?
Is this even possible? If not - what are possible workarounds for such a scenario?
This is what the FormData
object is looking like in the dev-tools:
which only has append
as method defined