Skip to content
← Back to activity

Public problem

customerio-node: ERR_INVALID_ARG_TYPE: The listener argument must be of type Function on track()

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Following the customerio-node docs for event tracking in Node.js, new TrackClient(siteId, apiKey, { region: RegionUS }) then await trackClient.track(userId, { name, data }) throws [ERR_INVALID_ARG_TYPE]: The "listener" argument must be of type Function. Received type object. The code matched the README example exactly.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

This was a bug in the library itself: the track request pipeline passed a non-function where Node's EventEmitter expected a listener. The maintainer reproduced it, shipped the fix in customerio-node v3.0.3 (tested first as 3.0.3-beta.1), and the reporter confirmed the fix. Upgrade to 3.0.3 or later. Source: https://github.com/customerio/customerio-node/issues/79

Source: https://github.com/customerio/customerio-node/issues/79