Skip to content
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

fetch errors when providing an abort signal #46823

Open
tatethurston opened this issue Feb 24, 2023 · 6 comments
Open

fetch errors when providing an abort signal #46823

tatethurston opened this issue Feb 24, 2023 · 6 comments
Labels
v18.x Issues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch.

Comments

@tatethurston
Copy link

Version

18.14.2

Platform

Darwin c889f3b32dab 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000 arm64 arm Darwin

Subsystem

No response

What steps will reproduce the bug?

Providing an instance of AbortSignal to fetch:

fetch("some url", { signal: AbortSignal.timeout(1500) })

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

Using fetch's signal does not error. This is the behavior in 18.14.0.

What do you see instead?

An error is raised:

The "emitter" argument must be an instance of EventEmitter or EventTarget. Received an instance of AbortSignal

Additional information

Related issues:

@tatethurston
Copy link
Author

Looking through the linked issues, the underlying issue seems to be fixed and this will be resolved when node 18.14.3 is available. Posting this primarily to save someone else some debugging and searching cycles.

@tatethurston
Copy link
Author

tatethurston commented Feb 24, 2023

Digging in further here, this only reproduces with nextjs on v 18.14.2. I'll follow up over there.

@camsjams
Copy link

This occurs when using Node 18.14.2 or greater, not just on nextjs.

See also nodejs/undici#1910 (comment)

Can you reopen please @tatethurston

@tatethurston tatethurston reopened this Mar 21, 2023
@targos targos added the v18.x Issues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch. label Mar 22, 2023
@aduh95
Copy link
Contributor

aduh95 commented Apr 22, 2023

Do you still see the issue on v18.16.0?

@benjamingr
Copy link
Member

An AbortSignal is an EventTarget - are you using the built in AbortSignal or something else?

@houfeng0923
Copy link

houfeng0923 commented Nov 5, 2023

v18.15.0 has.
it caused the cases related fetch can't pass.
v20.9 is ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v18.x Issues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch.
Projects
None yet
Development

No branches or pull requests

6 participants