Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Installing alongside kafka-node breaks gRPC #124

Closed
jwulf opened this issue Jan 22, 2020 · 7 comments
Closed

Installing alongside kafka-node breaks gRPC #124

jwulf opened this issue Jan 22, 2020 · 7 comments
Assignees

Comments

@jwulf
Copy link
Member

jwulf commented Jan 22, 2020

When you install zeebe-node and kafka-node in the same project - even if you don't import kafka-node - the gRPC client in zeebe-node breaks. You see an error message in the zeebe-node log output:

Cannot read property 'on' of undefined

See the reproducer here: https://github.com/need4eat/kafka-zeebe-test

It looks like kafka-node installs a version of Long that overwrites the version needed by zeebe-node's gRPC dependency.

@jwulf
Copy link
Member Author

jwulf commented Jan 22, 2020

@need4eat this seems to be fixed with 0.22.1 of zeebe-node and 5.0.0 of kafka-node. Can you test again?

I created a PR for it: jaikanth6/kafka-zeebe-test#1

@jaikanth6
Copy link
Contributor

Checked again with 0.22.1 of zeebe-node, issues still seems to persist.

@jwulf
Copy link
Member Author

jwulf commented Mar 9, 2020

It depends on installation order.

You have to install zeebe-node first, then install kafka-node.

Note: A working installation produces a package-lock.json that makes subsequent installations from the package.json work.

Case 0. Installation from package.json, with no package-lock, fails.

Fails.

npm i
// fails

Note: same behaviour with yarn and pnpm.

Case 1. Install from package.json, then zeebe-node, fails.

npm i
// fails
npm i zeebe-node
// fails

Case 2. Installing kafka-node first fails

npm i kafka-node
npm i zeebe-node
// fails

Case 3. Installing zeebe-node first works

npm i zeebe-node
npm i kafka-node
// works

Case 4. Installing kafka-node first, then deleting package-lock.json fails

npm i kafka-node
rm package-lock.json
npm i zeebe-node
// fails

Case 5. Installing zeebe-node first, then keeping the package-lock works

npm i zeebe-node
npm i kafka-node
rm -rf node_modules
npm i
// works

@jwulf
Copy link
Member Author

jwulf commented Mar 9, 2020

I've npm shrinkwrapped it for alpha-2. If that doesn't address it, we'll try https://github.com/rogeriochaves/npm-force-resolutions next.

@jwulf
Copy link
Member Author

jwulf commented Mar 9, 2020

I've added to an issue in kafka-node about it. It is an unmaintained package - https://github.com/cainus/BufferMaker - that they are using that locks long:

"dependencies": {
    "long": "1.1.2"
  },

@jwulf
Copy link
Member Author

jwulf commented Mar 9, 2020

Adding long to our package deps to hoist this.

WORKAROUND

You can install in any order if you npm i long as well.

We'll see if adding it to our explicit deps makes that unnecessary.

@jwulf
Copy link
Member Author

jwulf commented Mar 11, 2020

This is addressed in zeebe-node 0.23.0-alpha.2.

long has been added to the deps of zeebe-node, and you can now install kafka-node and zeebe-node in any order.

@jwulf jwulf closed this as completed Mar 11, 2020
@jwulf jwulf self-assigned this Mar 11, 2020
@jwulf jwulf mentioned this issue May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants