We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi Team, I need to use a previous version of the client while registering the fastifyelasticsearch in typescript. I am doing it like this
import fp from 'fastify-plugin'; import fastifyElasticsearch from '@fastify/elasticsearch'; import { Client } from '@elastic/elasticsearch'; export default fp(async (server) => { try { await server.register(fastifyElasticsearch, { client: new Client({ node: 'http://localhost:9200' }), }); } catch (error) { server.log.error(error, 'Failed to initialize Elasticsearch'); throw error; } });
But it is giving me an error for the new Client :
No overload matches this call. Overload 1 of 3, '(plugin: FastifyPluginCallback<FastifyElasticsearchOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...>): FastifyInstance<...> & PromiseLike<...>', gave the following error. Type 'Client' is missing the following properties from type 'Client': diagnostic, name, helpers, asyncSearch, and 72 more. Overload 2 of 3, '(plugin: FastifyPluginAsync<FastifyElasticsearchOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...>): FastifyInstance<...> & PromiseLike<...>', gave the following error.Overload 2 of 3, '(plugin: FastifyPluginAsync<FastifyElasticsearchOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...>): FastifyInstance<...> & PromiseLike<...>', gave the following error. Type 'import("/node_modules/@elastic/elasticsearch/index").Client' is not assignable to type 'import("/node_modules/@fastify/elasticsearch/node_modules/@elastic/elasticsearch/lib/client").default'. Overload 3 of 3, '(plugin: FastifyPluginAsync<FastifyElasticsearchOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger> | FastifyPluginCallback<...> | Promise<...> | Promise<...>, opts?: FastifyRegisterOptions<...>): FastifyInstance<...> & PromiseLike<...>', gave the following error. Type 'import("/node_modules/@elastic/elasticsearch/index").Client' is not assignable to type 'import("/node_modules/@fastify/elasticsearch/node_modules/@elastic/elasticsearch/lib/client").default'.ts(2769)
Can you help here to solve this issue?
The text was updated successfully, but these errors were encountered:
The plugin has this version: "@elastic/elasticsearch": "^8.2.1", https://github.com/fastify/fastify-elasticsearch/blob/master/package.json#L31
I'm not a TS user - can't suggest anything better than adding as any
as any
Sorry, something went wrong.
yes, the plugin has this version: "@elastic/elasticsearch": "^8.2.1", but i need to use a old version for client so thats why using the older version.
I would actually recommend to fork this plugin and patch it correctly.
No branches or pull requests
Hi Team,
I need to use a previous version of the client while registering the fastifyelasticsearch in typescript.
I am doing it like this
But it is giving me an error for the new Client :
Can you help here to solve this issue?
Your Environment
The text was updated successfully, but these errors were encountered: