-
-
Notifications
You must be signed in to change notification settings - Fork 461
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
(svelte) - "Failed to fetch" error not caught in CombinedError #2234
Comments
Ran into this with urql (React) as well. I have found that |
Simple: If not passing a custom fetcher, urql defaults to fetch("http://wjejfufiiendj").catch(console.error) Chromium 98 here logs Introduced here: The changelog says:
|
for reference |
I suppose this is a regression from #2210, since it 100% sounds like it, so I think I can preemptively confirm that this is a problem |
I can confirm we're seeing this behavior as well when the backend server is down. This caused us some interesting issues where dedup exchange would filter out reexecutions, since it believed queries were still in flight since it never received an |
…t will never show optimistic results Also use a cache-only requestPolicy to prevent refetching queries every time. It seems that cache-first gets upgraded to cache-and-network by graphcache upon receiving a mutation result. It's not known why it decides to do this right now. This was caused by the dedup exchange filtering out the reexecuted queries, believe them to be extraneous. It would never see the OperationResult coming back since server offline causes uncaught errors to be thrown from the fetch exchange. That in turn causes no errored results to come back. The easy fix is to simply place queries on the rebound channel, rather than reexecuting them through the client. Whether or not this is "correct" is hard to say. The underlying fix should be tracked via urql-graphql/urql#2234
This should be fixed in |
I'm using Svelte bindings. When my API in down and I try to query it, the error
Uncaught (in promise) Error: Failed to fetch
is thrown, and it is not reflected in$myOperationStore.error
. Instead,$myOperationStore.fetching
remainstrue
and$myOperationStore.error
remainsundefined
. So I'm not sure how to handle that case.Here is my code :
urql version:
@urql/svelte 1.3.3
Steps to reproduce
Uncaught (in promise) Error: Failed to fetch
in the consoleerror
andfetching
of the operationStoreExpected behavior
I suppose failing to fetch should result in a
networkError
held in theCombinedError
returned by the operationStore.Actual behavior
Error is ignored by urql and just happens with no way to handle.
The text was updated successfully, but these errors were encountered: