ofetch icon indicating copy to clipboard operation
ofetch copied to clipboard

i have a request when i abort this request will be a error "signal is aborted without reason"

Open ChinDer opened this issue 1 year ago • 2 comments

Environment

ofetch@^1.3.4: version "1.3.4"

[email protected]: version "3.8.2"

Reproduction

signal is new AbortController().signal

$fetch(url, { ...params, key, baseURL: VITE_API_URL, signal, onRequest(context: any) { // doing something }, onResponse(res: any) { const { error, response } = res // doing something return response._data }, onError(e: any) { console.log(e) }, })

Describe the bug

even though I cancelled the request, the return value is still there.

Additional context

No response

Logs

No response

ChinDer avatar Jul 24 '24 10:07 ChinDer

same issue here

tomchandra avatar Jul 27 '24 10:07 tomchandra

same as signal is defined.

lcandy2 avatar Sep 12 '24 19:09 lcandy2

any update on this?

alexchexes avatar Nov 09 '24 18:11 alexchexes

Actually, I can not reproduce it using the latest ofetch version.

EvgenyWas avatar Jan 07 '25 12:01 EvgenyWas

Could you please provide a minimal reproductoin with this example?

I tried what you described, and it works well (with the expected error thrown).

Image

kricsleo avatar Mar 28 '25 12:03 kricsleo