TheDeveloper/http-aws-es

Uncaught TypeError: self.on is not a function when trying to connect

Opened this issue · 4 comments

I get an error when trying to connect to ES on AWS.
Using this code supplied in the readme:

var es = require('elasticsearch').Client({
  hosts: 'https://amazon-es-host.us-east-1.es.amazonaws.com',
  connectionClass: require('http-aws-es'),
  amazonES: {
    region: 'us-east-1',
    accessKey: 'AKID',
    secretKey: 'secret'
  }
});

I guess it's a dependency that does not work as intended.

skarmavbild 2016-09-27 kl 22 05 13

skarmavbild 2016-09-27 kl 22 05 36

I am experiencing the same issue.

+1

I'm guessing the reason is this connector is designed to work from the server and not the browser?

I am experiencing this issue as well. I have a basic browser-based react app (through create-react-app: https://github.com/facebookincubator/create-react-app) with no node backend. does the client need to be established on the server?

@simtrax @mgsterling11 @johnnyfreeman @Matterful Has anyone of you been able to solve this issue? I experience the same with my react app. No idea how to work around this… any help would be appreciated.