nodefluent / kafka-streams

equivalent to kafka-streams :octopus: for nodejs :sparkles::turtle::rocket::sparkles:
https://nodefluent.github.io/kafka-streams/
MIT License
830 stars 111 forks source link

Error importing kafka-streams #47

Closed ZephD closed 6 years ago

ZephD commented 6 years ago

When importing the library with:

const { KafkaStreams } = require('kafka-streams')

I get the following error:

node_modules/sinek/lib/librdkafka/NConsumer.js:921
  async getLagStatus(noCache = false){
        ^^^^^^^^^^^^

SyntaxError: Unexpected identifier

This is due to the use of async in the Sinek Library.

I've tried with Node 8, 9 and 10, recompiling my node_modules each time. I've even tried with babel-register (and babel-polyfill), but making it also compile this library:

require('babel-register')({
  ignore: filename => !(!/\/node_modules\//.test(filename) || /\/node_modules\/sinek\//.test(filename)),
})
require('babel-polyfill') // both with and without this
const { KafkaStreams } = require('kafka-streams')

But it errors elsewhere:

node_modules/sinek/lib/librdkafka/Health.js:139
        return super.createCheck(STATES.UNCONNECTED, MESSAGES.UNCONNECTED);
               ^^^^^

SyntaxError: 'super' keyword unexpected here

Obviously this prevents me (and possibly further users) from even starting to use this library! Any help would be greatly appreciated.

ZephD commented 6 years ago

InteliJ was using my systems node path (/usr/bin/node) not nvm's node (.nvm/versions/node/v10.1.0/bin/node), so I was still using node 6 not 8, 9, 10 as I thought.

Sorry.