Apollo-link: Not loading on Internet Explorer

Created on 21 Dec 2017  Â·  7Comments  Â·  Source: apollographql/apollo-link

We're getting the following error for our IE users and stops the entire page loading for them:
fetch is not found globally and no fetcher passed.

We hope this will fix it:

import fetch from 'node-fetch';
        import { createHttpLink } from 'apollo-link-http';

        const link = createHttpLink({ uri: '/graphql', fetch: fetch });

Will update shortly if that worked.

question

Most helpful comment

Yeah, in the docs we recommend unfetch: https://www.apollographql.com/docs/link/links/http.html#fetch

Was it hard to find that documentation? How can we make this more visible?

All 7 comments

Sorry, node-fetch is node only. Will need another polyfill.

Yeah, in the docs we recommend unfetch: https://www.apollographql.com/docs/link/links/http.html#fetch

Was it hard to find that documentation? How can we make this more visible?

Great. See it now. I just did the update and our site is working for IE
users again. I used isomorphic fetch. Any issues using that? Or a reason to
prefer unfetch?

When looking for this issue I searched for Internet Explorer in both this
github repo and the Apollo Client repo. Hopefully others that run into this
in the future find the issue I opened. It may be worth adding the words
Internet Explorer explicitly to the docs.

Also, is there a reason you decided not to include this by default? Enough
people still use IE. We had 2 users complain to us about the site not
working within a day or so of using Apollo 2.

On 21 Dec 2017 20:14, "Sashko Stubailo" notifications@github.com wrote:

Yeah, in the docs we recommend unfetch: https://www.apollographql.com/
docs/link/links/http.html#fetch

Was it hard to find that documentation? How can we make this more visible?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/apollographql/apollo-link/issues/357#issuecomment-353419728,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC8oX4yzzXLTOQRjH30HARlEezIVDtiGks5tCp_xgaJpZM4RJ_Tn
.

Nope, isomorphic fetch is just fine!

Also, is there a reason you decided not to include this by default? Enough people still use IE.

This was one of the breaking changes in 2.0, but I think we might not have communicated it well. I think the conclusion was that the overwhelming majority of browsers include fetch and that we could document the polyfill. It's good to know that didn't quite come across, and I'll make sure I add it to the upgrade guide right now.

Maybe we can have a section called "browser compatibility" somewhere, like the Apollo Client docs.

Could you post a working example? I have tried both unfetch and isomorphic fetch and still cannot get it working.

@stubailo I would recommend adding a eye-catching "warning" mention and/or icon.
I guess the title "Fetch polyfill" isn't catchy enough for someone trying to have the simplest working configuration.

Since this issue is really outdated I am closing it but if you are still concerned about this feel free to reopen and I'll get back to you asap.

Was this page helpful?
0 / 5 - 0 ratings