honzahommer / grok-js

Regular expression template library for Node.js inspired by logstash grok filter module
ISC License
14 stars 6 forks source link

Conflict With KafkaJs #19

Closed lcharbon closed 4 years ago

lcharbon commented 4 years ago

Importing grok-js to an app with kafkajs will break kafkajs. await producer.send() will fail and return an empty array.

See minimal example here.

In this example, if const grok = require('grok-js'); is uncommented kafkajs will stop working.

Issue submitted to kafkajs here.

Nevon commented 4 years ago

I debugged this a little bit and found that it's because grok-js depends on the collections library, which replaces Array.from with an implementation that doesn't work with iterables. I would recommend dropping collections as a dependency.

honzahommer commented 4 years ago

@lcharbon Please install latest release (https://www.npmjs.com/package/grok-js/v/3.3.0). For now fixed by fork (https://github.com/honzahommer/collections/commit/394dd586aa782e79c716f1b11001d6cf42b88d0e).

@Nevon Thanks for help.