NuxtN
Nuxt5mo ago
14 replies
bnason

useFetch reactive triggering twice

I'm using vueuse useRouteQuery to get page and limit values from the query params. For the first page, those params don't exist so I have defaults setup. I'm then passing those to the useFetch query object. So the problem occurs when I'm on the first page and go to another page, I get 2 network fetchs to the api, the first one gets cancelled and the second one succeeds but the useFetch gives me the following error:
<no response> Request aborted as another request to the same endpoint was initiated.Caused by: AbortError: Request aborted as another request to the same endpoint was initiated.

If I'm on a page other than the first where the params are in the query and go to any other page (even the first page) it works perfectly.
Was this page helpful?