Skip to content
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

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

Closed
rbellamy opened this issue Jun 12, 2020 · 5 comments

Comments

@rbellamy
Copy link

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.
@rbellamy rbellamy changed the title No longer works as Agent for node-fetch node-fetch: Property 'freeSockets' is missing in type 'HttpsProxyAgent' but required in type 'Agent'. Jun 12, 2020
@hipstersmoothie
Copy link

This issue is blocking the merge of intuit/auto#1317

@baba43
Copy link

baba43 commented Jul 1, 2020

Any workaround for now?

@AndrewO
Copy link

AndrewO commented Jul 7, 2020

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

@nickelswitte
Copy link

Workaround would be to pass the agent as any

@TooTallNate
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants