Skip to content

node.js fetch is wrongly typed #61826

Closed
Closed
@bpasero

Description

@bpasero

⚙ Compilation target

ESNext

⚙ Library

5.8

Missing / Incorrect Definition

Image

https://undici.nodejs.org/#/docs/api/Dispatcher?id=parameter-responsedata

But thats not the case.

Sample Code

async function foo() {
    const res = await fetch('https://example.com');
    console.log(await res.bytes()); // error: Property 'bytes' does not exist on type 'Response'.ts(2339)
}

foo();

Documentation Link

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions