http-aws-es icon indicating copy to clipboard operation
http-aws-es copied to clipboard

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

Open simtrax opened this issue 9 years ago • 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

simtrax avatar Sep 27 '16 20:09 simtrax

I am experiencing the same issue.

mrobinson537 avatar Oct 01 '16 03:10 mrobinson537

+1

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

johnnyfreeman avatar Nov 12 '16 21:11 johnnyfreeman

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?

mgsterling11 avatar Jan 28 '17 16:01 mgsterling11

@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.

florianbepunkt avatar Apr 14 '17 17:04 florianbepunkt