Fix fetched Headers methods under @types/node - #617
Open
KayleeWilliams wants to merge 1 commit into
Open
KayleeWilliams wants to merge 1 commit into
KayleeWilliams wants to merge 1 commit into
Conversation
Contributor
|
@KayleeWilliams is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I hit this moving our CLI (inthhq/inth) to 0.2. Our HTTP client reads headers off fetch responses, and with
@types/nodeinstalled it crashes:It works on 0.1.7, and without
@types/node. undici-types declaresHeadersmethods as properties (readonly get: (name: string) => string | null), solower-calls.tsreadsgetoff the native handle and calls the result. The handle only answersgetas a method, so the read comes back undefined.This sends members declared by the standard library or
@types/nodeback throughdynInvoke, like 0.1.7 did. Callback properties in user code still go through read-then-call.The new node-types test fetches from a local server and compares with Node. It fails on main and passes with this. The corpus and the fetch tests pass otherwise, except
1640-fd-read-decode.ts,2283-structured-clone.cjs,stream-from-immediate-cancel,staticandstatic-stream-this, which fail on main for me too (Node 24.19). I didn't run the sanitized lane.