Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict With Grok-Js #623

Closed
lcharbon opened this issue Jan 7, 2020 · 3 comments
Closed

Conflict With Grok-Js #623

lcharbon opened this issue Jan 7, 2020 · 3 comments

Comments

@lcharbon
Copy link

lcharbon commented Jan 7, 2020

When the library grok-js is imported to an app with kafkajs the output of await producer.send() is 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 grok-js here.

@JaapRood
Copy link
Collaborator

JaapRood commented Jan 8, 2020

The only way I can see these two libraries conflict is if one of them mutates the environment, a global, altering the behaviour of some native functionality. A quick glance at the code of grok-js itself, I couldn't spot any, nor am I aware of the use of global in KafkaJS. More likely, I'd say, would be one of grok's dependencies being the culprit.

It'll be pretty hard to spot, which is exactly why the practice of mutating the environment shouldn't have passed code-review on this end. Good luck hunting it down, happy to help if you find anything more concrete!

@JaapRood JaapRood assigned JaapRood and unassigned JaapRood Jan 8, 2020
@Nevon
Copy link
Collaborator

Nevon commented Jan 8, 2020

This is because gork-js depends on collections, which replaces Array.prototype.from with a version that doesn't work with iterables. See montagejs/collections/issues/169

This breaks KafkaJS because in this line we pass an iterable to Array.from, which returns an empty array with collections implementation.

Closing this, as it has nothing to do with KafkaJS.

@Nevon Nevon closed this as completed Jan 8, 2020
@JaapRood
Copy link
Collaborator

JaapRood commented Jan 8, 2020

This is because gork-js depends on collections, which replaces Array.prototype.from with a version that doesn't work with iterables.

🤦‍♀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants