import fetch from "node-fetch"
import cp from "check-proxy"
const { check } = cp
TypeError [ERR_INVALID_ARG_TYPE]: The "listener" argument must be of type function. Received an instance of Object
at checkListener (node:events:277:3)
at ClientRequest.once (node:events:654:3)
at new ClientRequest (node:_http_client:244:10)
at Object.request (node:https:379:10)
at Object.<anonymous> (/home/lucasb/Dev/preco-supremo/preco-supremo-scraper-store-js/app/node_modules/proxy-agent/node_modules/agent-base/patch-core.js:23:20)
at Object.<anonymous> (/home/lucasb/Dev/preco-supremo/preco-supremo-scraper-store-js/app/node_modules/agent-base/patch-core.js:25:22)
at /home/lucasb/Dev/preco-supremo/preco-supremo-scraper-store-js/app/node_modules/pac-proxy-agent/node_modules/socks-proxy-agent/node_modules/agent-base/patch-core.js:23:20
at file:///home/lucasb/Dev/preco-supremo/preco-supremo-scraper-store-js/app/node_modules/node-fetch/src/index.js:94:20
at new Promise (<anonymous>)
at fetch (file:///home/lucasb/Dev/preco-supremo/preco-supremo-scraper-store-js/app/node_modules/node-fetch/src/index.js:49:9) {
code: 'ERR_INVALID_ARG_TYPE'
}
None new http client library seems to work, must be a issue related to outdated dependencies.
I updated the dependencies with ncu -u command. Fixes the error, but library seens to does not work.
Works if i remove check-proxy import