MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
945 stars 278 forks source link

RequestError: The "listener" argument must be of type function error when upgrading #657

Open pbrink231 opened 1 month ago

pbrink231 commented 1 month ago

I am upgrading from V2.25.1, I have no issues with this version. I didn't change any code. the call that is throwing an error is shopify.order.count()

I am trying to upgrade to V3.13.2 but this error is with any V3 version starting with V3.0.0

It seems this error is coming from the got package. I don't use any events at the moment so no .on() calls on the Shopify instance. The error message seems related to event emitter from searching.

I am on node version 20.11.0

I have removed the node_modules folder and reinstalled after the update but that did not solve the issue. Tried tracking it down more but could not figure out what was going on. The object Shopify package is calling to the got package looks fine. I am thinking there is some .on() somewhere in the Shopify package that is an issue?

RequestError: The "listener" argument must be of type function. Received an instance of Object
at Request._makeRequest (C:\Users\beast\programs\crm-server\node_modules\got\dist\source\core\index.js:1183:19) at C:\Users\beast\programs\crm-server\node_modules\got\dist\source\core\index.js:334:28 at checkListener (node:events:275:3) at ClientRequest.once (node:events:652:3) at new ClientRequest (node:_http_client:239:10) at Object.request (node:https:378:10) at Object. (C:\Users\beast\programs\crm-server\node_modules\agent-base\patch-core.js:23:20) at C:\Users\beast\programs\crm-server\node_modules\https-proxy-agent\node_modules\agent-base\patch-core.js:25:22 at Request._makeRequest (C:\Users\beast\programs\crm-server\node_modules\got\dist\source\core\index.js:1130:43) at C:\Users\beast\programs\crm-server\node_modules\got\dist\source\core\index.js:334:28 at processTicksAndRejections (node:internal/process/task_queues:95:5) { code: 'ERR_INVALID_ARG_TYPE', timings: undefined }