TooTallNate / proxy-agents

Node.js HTTP Proxy Agents Monorepo
https://proxy-agents.n8.io
919 stars 239 forks source link

node-fetch: Property 'freeSockets' is missing in type 'HttpsProxyAgent' but required in type 'Agent'. #108

Closed rbellamy closed 1 year ago

rbellamy commented 4 years ago
plugins/slack/src/index.ts:178:7 - error TS2322: Type 'HttpsProxyAgent | undefined' is not assignable to type 'Agent | ((parsedUrl: URL) => Agent) | undefined'.
  Type 'HttpsProxyAgent' is not assignable to type 'Agent | ((parsedUrl: URL) => Agent) | undefined'.
    Property 'freeSockets' is missing in type 'HttpsProxyAgent' but required in type 'Agent'.

178       agent: proxyUrl ? createHttpsProxyAgent(proxyUrl) : undefined,
          ~~~~~

  node_modules/@types/node/http.d.ts:362:18
    362         readonly freeSockets: NodeJS.ReadOnlyDict<Socket[]>;
                         ~~~~~~~~~~~
    'freeSockets' is declared here.
hipstersmoothie commented 4 years ago

This issue is blocking the merge of https://github.com/intuit/auto/pull/1317

baba43 commented 4 years ago

Any workaround for now?

AndrewO commented 4 years ago

I had this as well. The solution was to downgrade @types/node to a 12.x.y version.

nickelswitte commented 4 years ago

Workaround would be to pass the agent as any

TooTallNate commented 1 year ago

agent-base now extends directly from Node's http.Agent, so this should be fixed as of the latest release.