Skip to content

Unable to pass options when using with node-fetch #13

@bmxpiku

Description

@bmxpiku

Hey,
Im failing to implement this library for node-fetch, and maybe you will have some idea:

import https from 'https';
// @ts-ignore
import { lookup } from 'lookup-dns-cache';

const dnsAgent = (): https.Agent => new https.Agent({
  lookup: lookup(4),
  keepAlive: true,
});

// and then usage within fetch
await fetch(uri, {
      method: 'POST',
      body: JSON.stringify(requestParams),
      headers: { 'Content-Type': 'application/json' },
      agent: dnsAgent,
    });

It fails with an error "options must be an object or an ip version number"
which I see in library code, but passing object {family: 4} also causes same failure

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions