Javascript issue in ehub_collector.js attempting to call .map() function on an object
Opened this issue · 0 comments
j-kressdesigns commented
ehub-collector/common/ehub_collector.js
Line 38 in 241bdaa
I attempted to debug and run my installation of ehub-collector by running npm run local-ehub-general and received error:
TypeError: rawMessages.map is not a function
at module.exports (my-project-directory\common\ehub_collector.js:38:42)
This happens because map() method is defined on Array, and does not exist in Object. This worked:
const eventHubMessages = Array.isArray(rawMessages) ? rawMessages.map(message => {
...
}) : [];
Function worked fine after this change and my logs are ingested properly now. Is there an expectation that rawMessages might be an Object instead of an Array?