lifeomic/axios-fetch

Not working in IE11

Vikas-Kumar56 opened this issue · 5 comments

Not working in IE11 becuase In library you are using node-fetch module which does not work in ie11 so please include
require('es6-promise').polyfill();
require('isomorphic-fetch');

top of your code.

Cause of issue: inside node-fetch

var getGlobal = function () {
// the only reliable means to get the global object is
// Function('return this')()
// However, this causes CSP violations in Chrome apps.
if (typeof self !== 'undefined') { console.log('self', self.fetch); return self; }
if (typeof window !== 'undefined') { console.log('window'); return window; }
if (typeof global !== 'undefined') { return global; }
throw new Error('unable to locate global object');
}

var global = getGlobal();
console.log('global', global);
module.exports = exports = global.fetch;

exports.default = global.fetch.bind(global); this line throw exception becuase fetch is undefined in ie11

Would it be possible to document that polyfills are needed to support ie11 and avoid adding the polyfills for all consumers?

Yes, You are right. no need to inlcude these polyfill in library just document these for ie 11.

Would you be willing to contribute the updated documentation? I haven't tried to support IE 11 and you might have the steps you did to make it work from your efforts yesterday