Latest release breaks algoliasearch types
Shows how to fix latest release breaks algoliasearch types. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
The algoliasearch release that broke TypeScript types (re-exported types going missing in dependent packages) was fixed in 5.10.2. Issue algolia/algoliasearch-client-javascript#1562 (closed, 13 comments): ### Description In 5.9.0 (migrating from 5.8.1), types are broken for algoliasearch.
Steps
- The algoliasearch release that broke TypeScript types (re-exported types going missing in dependent packages) was fixed in 5.10.2.
- Issue algolia/algoliasearch-client-javascript#1562 (closed, 13 comments): ### Description In 5.9.0 (migrating from 5.8.1), types are broken for algoliasearch.
When to use
You are seeing this: Issue algolia/algoliasearch-client-javascript#1562 (closed, 13 comments): ### Description In 5.9.0 (migrating from 5.8.1), types are broken for algoliasearch. Use this skill when you run into "Latest release breaks algoliasearch types".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: 5.9.0, 5.8.1, 5.10.2. If you are on something much newer or older, the details may have shifted.
Why this happens
From my quick investigation, the package references types from @algolia/client-search, however this is not a dependency of algoliasearch and causes TypeScript to return any.
Sources
- https://github.com/algolia/algoliasearch-client-javascript/issues/1562