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

Uncaught TypeError: Failed to fetch simulated offline in Google Chrome. #9871

Open
LiamKarlMitchell opened this issue Jul 1, 2022 · 5 comments
Labels
🐞 bug 🔍 investigate Investigate further

Comments

@LiamKarlMitchell
Copy link

LiamKarlMitchell commented Jul 1, 2022

Intended outcome:

When making a query or polling query and the network has an outage/offline/disconnected.
NetworkError is caught, retry-link retries.
Polling queries would retry.

Actual outcome:

Uncaught TypeError: Failed to fetch.

Uncaught TypeError: Failed to fetch
    at eval (createHttpLink.js?53eb:96:1)
    at new Subscription (module.js?c1e0:190:1)
    at Observable.subscribe (module.js?c1e0:264:1)
    at subscribeObservable.subscribe (pusher-link.ts?1f2c:32:1)
    at eval (index.js?9187:11:1)
    at new Subscription (module.js?c1e0:190:1)
    at Observable.subscribe (module.js?c1e0:264:1)
    at RetryableOperation.try (retryLink.js?d616:103:1)
    at RetryableOperation.start (retryLink.js?d616:91:1)
    at RetryLink.request (retryLink.js?d616:134:1)

When network connection comes back.
No retry attempts are made, and no polling queries are retried everything just stops.

How to reproduce the issue:

Have a retry-link.

Make a query or polling query during a network outage.
Can simulate network outage in Chrome Network tab under the throttling drop down.
Restore network connection and see that nothing is retried.

Versions

  System:
    OS: Windows 10 10.0.19044
  Binaries:
    Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.3.0 - ~\AppData\Roaming\npm\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (103.0.1264.37)
  npmPackages:
    @apollo/client: ^3.6.9 => 3.6.9
    vue-apollo: ^3.1.0 => 3.1.0

Suspect this is related to #9870

@jpvajda
Copy link
Contributor

jpvajda commented Jul 7, 2022

@LiamKarlMitchell Thanks for reporting this, it certainly might be related to #9870, so let's see what @MrDoomBringer thinks, as he was working on that issue.

@jpvajda jpvajda added 🔍 investigate Investigate further 🐞 bug labels Jul 7, 2022
@LiamKarlMitchell
Copy link
Author

To be fair, I do have Vue Apollo.
But this error is coming from apollo client createHttpLink.js, fetch errors seem like they are unhandled so it never makes the ApolloError for me to catch and handle in retry-link or an error-link.

@LiamKarlMitchell
Copy link
Author

Is there a way I can have package.json switch over to using the git repo I clone from this project?
Then I could muck with the code possibly see where issue is?

@MrDoomBringer
Copy link
Contributor

@LiamKarlMitchell Hi! Thanks a ton for opening this issue. I'd need to take a bit of a deeper dive before I can confirm it's related to #9870, as for the most part that issue relates to error reporting, rather than re-polling/fetching errors.

Is there a way I can have package.json switch over to using the git repo I clone from this project?

Yep! After cloning and building this repo, cd to /dist and run npm pack which will create a file named apollo-client-3.xx.tgz in the apollo-client/dist directory

Then in your app, run npm i ~/path/to/folder/apollo-client/dist/apollo-client-3.xx.tgz to install the newly built/modified client. You should see the package.json change to look something like this:
image

@LiamKarlMitchell
Copy link
Author

Still a concern, but I have not had the time to investigate it further yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug 🔍 investigate Investigate further
Projects
None yet
Development

No branches or pull requests

3 participants