You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the searchClient has been altered in hydrateSearchClient, the client can't be used in the way algolia search client should be expecting params, because it expected "flat" parameters along indexName, while the modification made by hydrateSearchClient expect everything to be nested in a params object.
I'm not sure how we could avoid this as notably algoliasearch v4 only accepts the flat parameters. As an initial workaround, you can use the "legacy search parameters" argument to client.search, which is the flat array.
TypeScript indeed won't warn about that, but at least it will work
🐛 Current behavior
After the searchClient has been altered in
hydrateSearchClient
, the client can't be used in the way algolia search client should be expecting params, because it expected "flat" parameters alongindexName
, while the modification made byhydrateSearchClient
expect everything to be nested in aparams
object.🔍 Steps to reproduce
Here's a reproduction repo: https://github.com/Shywim/instantsearch-nextjs-params
Note the additional search done after the state has been rendered on the server: https://github.com/Shywim/instantsearch-nextjs-params/blob/fd5994ab03c4a1f3ea36689f8dbe0a8f5b5b2c9d/src/pages/index.tsx#L149-L151
Live reproduction
https://codesandbox.io/p/github/Shywim/instantsearch-nextjs-params/main
💭 Expected behavior
We should be able to use the searchClient after it has been passed to InstantSearch.
Package version
instantsearch.js 7.15.3, algoliasearch 5.20.3
Operating system
No response
Browser
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: