Elasticsearch-js: Using apiVersion 5.x is broken since latest release

Created on 13 Jun 2017  ·  5Comments  ·  Source: elastic/elasticsearch-js

Since the last release of this module I am unable to use apiVersion 5.x. This still worked with the previous release. According to the documentation I would assume it should work.

Test code:

const elasticsearch = require('elasticsearch');

const client = new elasticsearch.Client({
  hosts: ['localhost:9200'],
  apiVersion: '5.x'
});

client.ping({
  requestTimeout: 1000
}, function (error) {
  if (error) {
    console.trace('elasticsearch cluster is down!');
  } else {
    console.log('All is well');
  }
});

The error is as follows:

TypeError: Cannot read property 'prototype' of undefined
    at Object.<anonymous> (.../node_modules/elasticsearch/src/lib/apis/5_x.js:4990:31)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.get 5.x [as 5.x] (.../elasticsearch/src/lib/apis/index.js:11:24)
    at Object._.funcEnum (.../elasticsearch/src/lib/utils.js:343:20)

Most helpful comment

FWIW, I'm having the same issue. Rolled back to 13.0.0 and the error is gone.

All 5 comments

FWIW, I'm having the same issue. Rolled back to 13.0.0 and the error is gone.

I have the same error with the latest version.

Thanks everyone, this was caused by the new ingest.processor.* api. The generator wasn't prepared to handle methods that had multiple path segments. Fixed in 629c7498ae51a7192595de0cb82bb77c0b0895cf and released in v13.1.1

@spalger - when I install the latest version 13.1.1 I get an unmet peer dependency on [email protected]

├── UNMET PEER DEPENDENCY [email protected]
└── [email protected]

I have [email protected] installed as a dev dependency. Shouldn't it be a dev dependency for elasticsearch?

@aleybovich pretty sure that's unrelated to elasticsearch-js, we don't depend on chai

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lizpark picture lizpark  ·  3Comments

mfaizanse picture mfaizanse  ·  3Comments

sjparkinson picture sjparkinson  ·  5Comments

rtercias picture rtercias  ·  4Comments

peshrawahmed picture peshrawahmed  ·  3Comments