Using apiVersion 5.x is broken since latest release
See original GitHub issueSince 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:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FWIW, I’m having the same issue. Rolled back to 13.0.0 and the error is gone.
@aleybovich pretty sure that’s unrelated to elasticsearch-js, we don’t depend on chai