question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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 https://github.com/apollographql/apollo-client/issues/9870

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
MrDoomBringercommented, Jul 8, 2022

@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

0reactions
LiamKarlMitchellcommented, Aug 6, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

PWA not working correctly offline. Uncaught (in promise ...
... in simulated offline mode. So, in your case, the service worker should return a cached 'index.html' when fetch(event.request) is failed.
Read more >
ERR_INTERNET_DISCONNECT...
If the error repros, "Uncaught TypeError: Failed to fetch" is printed to ... if the service worker code calls fetch() while the 'simulated...
Read more >
Re: Undocumented TypeError: Failed to fetch - Google Cloud ...
It seems from what you observe, the browser treats the the CORS response from Apigee as insufficient. You can use Apigee trace to...
Read more >
Randomly fails to load while fetching multiple resources
Tried testing the issue on chrome reported version# 70.0.3538.77 using Windows-10 ... Actual: "Uncaught (in promise) TypeError: Failed to fetch TypeError: ...
Read more >
How to Fix the "ERR_CONNECTION_RESET" Error (5 Ways)
Learn how to fix the "ERR_CONNECTION_RESET" error code that displays in Google Chrome because there was a failed connection.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found