ctimmerm / axios-mock-adapter

Axios adapter that allows to easily mock requests
MIT License
3.47k stars 245 forks source link

on 1.20.0 IE11 breaks #324

Closed SylRob closed 1 year ago

SylRob commented 2 years ago

(for my work I still have to support IE11)

the culprit is is-blob

the imported script is not es5 compiled (just because it use an arrow function...)

module.exports = value => {
    if (typeof Blob === 'undefined') {
        return false;
    }

    return value instanceof Blob || Object.prototype.toString.call(value) === '[object Blob]';
};

a really simple fix would be to just create a isBlob function in the utils file

there is an other fix, add is-blob into the exclude setting of babel-loader something like that :

{
    test: /\.js$/,
    exclude: [/node_modules\/(?!(is-blob)\/).*/],
    loader: 'babel-loader',
  },

(this seem to work for me so far) (I use webpack with babel)

I don't know if you care about IE11 support but this is just to let you guys know. if you don't want to support IE11 a nice compromise would be to put something in the Readme ?

marcbachmann commented 1 year ago

sorry, just use a correct babel setup. This module only supports newer runtimes.