Skip to content
New issue

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

Module '"algoliasearch/lite"' has no exported member 'SearchClient'.ts(2305) #1290

Open
spacecat opened this issue Nov 28, 2024 · 3 comments

Comments

@spacecat
Copy link

spacecat commented Nov 28, 2024

Line 1:

import type { SearchClient } from 'algoliasearch/lite';

In this file:

https://github.com/algolia/autocomplete/blob/next/examples/react-instantsearch/src/components/Autocomplete.tsx

is giving me the following error:

Module '"algoliasearch/lite"' has no exported member 'SearchClient'.ts(2305)

How to fix?

I'm using the following npm packages:

"@algolia/autocomplete-js": "1.17.7",
"@algolia/autocomplete-plugin-query-suggestions": "1.17.7",
"@algolia/autocomplete-plugin-recent-searches": "1.17.7",
"@algolia/autocomplete-theme-classic": "1.17.7",
"algoliasearch": "5.15.0",
"react-instantsearch": "7.13.8",
"typescript": "5.7.2"
@Haroenv
Copy link
Contributor

Haroenv commented Nov 29, 2024

This example still has algoliasearch v4. Either:

  • change to algoliasearch v4 and use the example as-is
  • change import type { SearchClient } from 'algoliasearch/lite' to import type { LiteClient as SearchClient } from "algoliasearch/lite"; and use v5 lite

Will leave this issue open until we update the examples to use v5 to avoid confusion

@spacecat
Copy link
Author

spacecat commented Nov 30, 2024

This example still has algoliasearch v4. Either:

  • change to algoliasearch v4 and use the example as-is
  • change import type { SearchClient } from 'algoliasearch/lite' to import type { LiteClient as SearchClient } from "algoliasearch/lite"; and use v5 lite

Will leave this issue open until we update the examples to use v5 to avoid confusion

Thanks, I will try the second option in the coming days and report back.

@spacecat
Copy link
Author

The following seems to be working - just updated my code:

change import type { SearchClient } from 'algoliasearch/lite' to import type { LiteClient as SearchClient } from "algoliasearch/lite"; and use v5 lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants