matthew-andrews / isomorphic-fetch

Isomorphic WHATWG Fetch API, for Node & Browserify
MIT License
6.95k stars 289 forks source link

Using isomorphic-fetch in Edge #123

Closed adrienharnay closed 7 years ago

adrienharnay commented 7 years ago

Hi,

So this is more of a question: I have some issues using this polyfill on Edge. Reading the docs, I thought I understood it replaced the native fetch, even if it were already implemented in the browser.

So, as the fetch in Edge 14 is a bit broken, I use: import 'isomorphic-fetch'; at the root of my project. But I still get the TypeMismatchError when I try to execute even the simplest fetch() under Edge... Works like a charm under Chrome & Mozilla though.

Any insights?

Thanks in advance.

adrienharnay commented 7 years ago

I worked around by deleting window.fetch in Edge before importing isomorphic-fetch.

sontek commented 7 years ago

@Zephir77167 Can you provide a code example of how you did this?

adrienharnay commented 7 years ago

Yes of course. Here it is:

if (navigator && /Edge/.test(navigator.userAgent)) {
  delete window.fetch;
}