autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

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

Open spacecat opened this issue 1 year ago • 3 comments

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"

spacecat avatar Nov 28 '24 18:11 spacecat

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

Haroenv avatar Nov 29 '24 08:11 Haroenv

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 avatar Nov 30 '24 12:11 spacecat

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

spacecat avatar Nov 30 '24 19:11 spacecat