-
Notifications
You must be signed in to change notification settings - Fork 542
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
(types) undici.Response cannot be assigned to Response #3639
Comments
Okay, regardless of the |
I think the types are correct here. undici.fetch doesn't return a global response. |
It's not the global that i'm questioning here, it's the type (well its typescript so really just the TS interfaces), and the those must conform (or extend) the global one's otherwise users cannot use an undici Response in places where the type (interface) of standard Response is expected. Developers can opt-in to allow global-like objects by not doing an |
It's these helpers typings that are available in node's V8 already that are missing. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
The issue afaict is that the DOM types replaced the old iterator(s) types with a "HeadersIterator". All we should need to do is implement something similar. Lmk if my understanding of the issue is wrong :) |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I investigated this and there are two issues.
The second one has to be implemented in undici and probably added here: Line 968 in 44a7e91
I guess they are trivial changes, if you know how the iterable helper functions work... |
|
Bug Description
type undici.Response cannot be assigned to type Response so that module authors can use globally available
Response
as a type but users may useundici
as the implementation to obtain one.Reproducible By
https://gist.github.com/panva/a350238b643aef7a77b29e6db395c3b9
Expected Behavior
The types should be compatible.
Logs & Screenshots
The text was updated successfully, but these errors were encountered: