-
Notifications
You must be signed in to change notification settings - Fork 40
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
DOMException [AbortError]: This operation was aborted #24
Comments
Could you create a minimal reproduction for this issue? I'd need to see that myself to look into that. |
@phryneas I found out it's this line that caused the above DOM Exception AbortError. Any idea why this line is needed? Currently, to avoid this abortController call to trigger the AbortError, I passed my own signal to fetchOptions, but I don't know what side effect will this incur? Will it affect any cleanup action that apollo client does? And in the polls-demo example, you can reproduce this issue by removing |
I've done some digging here. Essentially: this is the doing of Next.js, and there is probably nothing we can do about it. You can find the related code here: Here, Next.js calls Now, we make every request with an Your workaround essentially means that you take control over the Honestly, at this point I don't really know what we can do here :/ Maybe you can also open an issue over at the Next repo? |
For me it looks like this
and
doesn't work too. I am taking this directly from this resource If I do this:
it works perfectly fine |
It's very possible that the fact that we cancel our AbortController after the request, and they just blindly reuse that AbortController means that their revalidation request never happens. :/ That's why you don't mess with fetch :( |
I believe this has been fixed quite a while ago in HttpLink, so I'm closing this here. |
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. |
Hi,
Thanks for putting up this awesome library! I recently started to use Apollo client to hit our graphQL api using Next.js app router. Currently, after a (SSR/SSG with
export const revalidate = xxx
) page is first loaded, then subsequently refreshing it in browser givesDOMException [AbortError]: This operation was aborted
. From an old post while googling, I was able to make this error disappear by configuring an abortController in the httpLink, but my gut feeling tells me this probably is not the right way to address this problem.Could you please shed some light on how to solve this the right way? Thank you!

My apollo client configuration is this:

The text was updated successfully, but these errors were encountered: