unjs / ofetch

😱 A better fetch API. Works on node, browser and workers.
MIT License
4.06k stars 128 forks source link

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

Open ChinDer opened 2 months ago

ChinDer commented 2 months ago

Environment

ofetch@^1.3.4: version "1.3.4"

nuxt@3.8.2: 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

tomchandra commented 2 months ago

same issue here

lcandy2 commented 1 month ago

same as signal is defined.