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

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.

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