question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using apiVersion 5.x is broken since latest release

See original GitHub issue

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)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
neauvacommented, Jun 13, 2017

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

0reactions
spalgercommented, Jun 17, 2017

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

UnsupportedApiVersion error when giving some different ...
So what does that have to do with versioning? The versioning endpoint matcher policy invalidates any valid candidate by API version. This should ......
Read more >
c# - Web-API Versioning not working with Default version
Here my assumption is if I didn't pass the version, by default it will select version 1. Controller code: [ApiVersion("1.0")] [RoutePrefix("api/ ...
Read more >
Overview of API Versioning in ASP.NET Core 3.0+
options.DefaultApiVersion = new ApiVersion(1, 0); - This setting is not mandatory, because by default it is assumed that the initial version is ...
Read more >
How to Implement Web API Versioning in ASP.NET Core
After defining multiple versions of the same controller as shown above you can invoke these by using the version number in the query...
Read more >
Versions in Azure API Management | Microsoft Learn
Clients can choose to use your new API version when they're ready, ... version ensures that any existing callers are not broken by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found