Closed Haroenv closed 5 months ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 1d6fd7a8cfa21d5fdd8c95bd4a3c7b845fcd6f67:
Sandbox | Source |
---|---|
example-instantsearch-getting-started | Configuration |
example-react-instantsearch-getting-started | Configuration |
example-react-instantsearch-next-app-dir-example | Configuration |
example-react-instantsearch-next-routing-example | Configuration |
example-vue-instantsearch-getting-started | Configuration |
I can't manage to reproduce this locally, even if i update everything to 5.4.5, but in a fresh Next.js example (like https://codesandbox.io/s/47fy7c)
hitsPerPage
isn't accepted to Configure (because PlainSearchParameters is any)This is I believe linked to https://github.com/microsoft/TypeScript/pull/56004, maybe also to https://github.com/sindresorhus/type-fest/issues/846 (although the case seems different).
Essentially before this change the types like
ClientLiteV5
were evaluated toany
instead ofunknown
, poisoning the entire type and turning everything into any.The solution is to first check if
typeof AlgoliaSearchLite
is any, and if it is any we don't even evaluate the rest of teh type. Of course if it isn't any it works correctly for v5 still.Again, unfortunately this isn't reproducible in this repo, even when every typescript version is updated to 5.4.5, but at least the error will be fixed
fixes #5989