Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working in IE11 #38

Open
Vikas-Kumar56 opened this issue Jan 27, 2020 · 5 comments
Open

Not working in IE11 #38

Vikas-Kumar56 opened this issue Jan 27, 2020 · 5 comments

Comments

@Vikas-Kumar56
Copy link
Contributor

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

@mdlavin
Copy link
Member

mdlavin commented Jan 27, 2020

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

@Vikas-Kumar56
Copy link
Contributor Author

Vikas-Kumar56 commented Jan 27, 2020 via email

@Vikas-Kumar56
Copy link
Contributor Author

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

@mdlavin
Copy link
Member

mdlavin commented Jan 28, 2020

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

@Vikas-Kumar56
Copy link
Contributor Author

Vikas-Kumar56 commented Jan 29, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants