We have just upgraded from v4 to v5 (specifically v5.1.0) and ran into some issues when using the methods, primarily with the types.
We noticed some issues like:
Unsafe assignment of an error typed value.eslint[@typescript-eslint/no-unsafe-assignment](https://typescript-eslint.io/rules/no-unsafe-assignment)
Could not find a declaration file for module '@algolia/client-search'
After some investigation, I when adding the types to the exports field in the manifest, the issues would be mostly solved
The client search package for example.
It looks like all the packages need to be updated in a similar fashion which will allow the, otherwise when using the clients, we have to define the client list so (Note we patched the two packages to allow us to upgrade now)
import { algoliasearch } from "algoliasearch";
// These should not be needed
import type { SearchClient } from "@algolia/client-search";
import type { RecommendClient } from "@algolia/recommend";
// this return type should be infered
export function getAlgoliaClient(): SearchClient {
return algoliasearch(ALGOLIA_APP_ID, ALGOLIA_API_KEY);
}
// as above
export function getAlgoliaRecommendationClient(): RecommendClient {
return algoliasearch(ALGOLIA_APP_ID, ALGOLIA_API_KEY).initRecommend();
}
We have just upgraded from v4 to v5 (specifically v5.1.0) and ran into some issues when using the methods, primarily with the types. We noticed some issues like:
Unsafe assignment of an error typed value.eslint[@typescript-eslint/no-unsafe-assignment](https://typescript-eslint.io/rules/no-unsafe-assignment)
Could not find a declaration file for module '@algolia/client-search'
After some investigation, I when adding the types to the exports field in the manifest, the issues would be mostly solved The client search package for example.
It looks like all the packages need to be updated in a similar fashion which will allow the, otherwise when using the clients, we have to define the client list so (Note we patched the two packages to allow us to upgrade now)