-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
(Batch)HttpLink Uncaught (in promise)DOMException: signal is aborted without reason #11873
Comments
Hey @Cellule 👋 Thanks for the report! By chance do you see the same thing with apollo-client/src/link/http/createHttpLink.ts Lines 210 to 213 in d502a69
If you're not seeing this issue in |
I just tested and indeed same behavior with HttpLink. |
I'm close to get a minimal repro. Manage to at least setup http link in code sandbox at least, but it's not reproing in my setup yet |
Alright, we finally managed to find the problem. I have updated the repro above showing the issue. In essence we had code looking like this const httpLink = new HttpLink({
uri: `/graphql`,
fetch: (...args) => {
const res = fetch(...args);
res.then(
(value) => {
// inspect response headers to update application state
},
// This was missing, so the rejection from fetch was unhandled in this .then()
// Causing to print the error
// (err) => {/* Ignore fetch errors */}
);
return res;
},
}); |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
Glad you found the source of the issue! Appreciate you letting us know! Have a great rest of your day 🙂 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue Description
Similar issue as #10520 but happens when using BatchHttpLink
It seems the abort here causes an error to surface up when navigating quickly between pages (aka when useQuery cancels a request)
apollo-client/src/link/batch-http/batchHttpLink.ts
Lines 231 to 234 in d502a69
I'm not sure how I can handle this on my side or if it's something that needs to be fixed in batch-http-link class
Link to Reproduction
I tried, I really tried
Reproduction Steps
@apollo/client
version3.10.4
The text was updated successfully, but these errors were encountered: