Skip to content

node-ssllabs breaks node-fetch #10

@rafipiccolo

Description

@rafipiccolo

This code breaks. only when i import node-ssllabs. when i comment it out it works.

import ssllabs from 'node-ssllabs'; // try commenting this line to make the code work
import fetch from 'node-fetch';

const res = await fetch('https://httpbin.org/get');
const json = await res.json();
console.log(json);

error stack:

node:internal/errors:484
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "listener" argument must be of type function. Received an instance of Object
    at checkListener (node:events:266:3)
    at ClientRequest.once (node:events:647:3)
    at new ClientRequest (node:_http_client:237:10)
    at Object.request (node:https:360:10)
    at Object.<anonymous> (/root/docker/check/node_modules/agent-base/patch-core.js:25:22)
    at /root/docker/check/node_modules/socks-proxy-agent/node_modules/agent-base/patch-core.js:23:20
    at file:///root/docker/check/node_modules/node-fetch/src/index.js:94:20
    at new Promise (<anonymous>)
    at fetch (file:///root/docker/check/node_modules/node-fetch/src/index.js:49:9)
    at file:///root/docker/check/tryrequest.js:4:19 {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v18.10.0

seems related to this : #5

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