-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Unexpected error when using signal with reason in fetch #49557
Comments
This also happens in node v20.6.1 |
@alexkorsun the underlaying issue is with https://github.com/nodejs/undici, and the issue here is the This was already fixed in nodejs/undici#2243, which was released in |
node:internal/deps/undici/undici:11372
Error.captureStackTrace(err, this);
^
TypeError: invalid_argument
at Function.captureStackTrace (<anonymous>)
at Object.fetch (node:internal/deps/undici/undici:11372:11)
Node.js v20.9.0 |
@atlowChemi Can this issue be reopened please? I am still seeing this issue in Node 20.10.0 (with Undici 5.26.4, based on the changelog). |
@ShadowLNC does the code above reproduce the issue for you? CC @nodejs/undici |
@atlowChemi Using the code from the original issue description, I do indeed get the For my other testsing I was using this one-line script > fetch('https://example.com', {signal: AbortSignal.abort()});
Promise {
<pending>,
[Symbol(async_id_symbol)]: 1082,
[Symbol(trigger_async_id_symbol)]: 6
}
> Uncaught:
DOMException [AbortError]: This operation was aborted
at Object.fetch (node:internal/deps/undici/undici:11730:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
> fetch('https://example.com', {signal: AbortSignal.abort("fake error")});
Promise {
<pending>,
[Symbol(async_id_symbol)]: 1139,
[Symbol(trigger_async_id_symbol)]: 6
}
> Uncaught TypeError: invalid_argument
at Function.captureStackTrace (<anonymous>)
at Object.fetch (node:internal/deps/undici/undici:11730:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
> |
I came across this as I had the same issue even with v21.7.31. I fixed it with Causes the undici error - Hope this helps anyone with similar issue. |
FYI, the fix in undici was released in https://github.com/nodejs/undici/releases/tag/v6.3.0, and is available in Node in v22.0.0. |
Version
18.17.1
Platform
Linux undefined 6.2.0-32-generic #32~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 18 10:40:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
fetch
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
The expected behavior is to have
[AbortError]: This operation was aborted
with the reason obtained from the signal.What do you see instead?
When
reason = undefined
When
reason = object
When
reason = string
Additional information
No response
The text was updated successfully, but these errors were encountered: