-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react-instantsearch doesn't support algolia v5 #6426
Comments
Hi, InstantSearch is typed to expect the API client coming from import { liteClient as algoliasearch } from 'algoliasearch/lite';
// or
import { algoliasearch } from 'algoliasearch'; |
Thanks for answering so quickly! Tried that one already. Seems like it's working, but in both cases
|
There could be a version conflict in your package dependencies. Could you ideally reproduce this behavior using the following sandbox as a starting point: https://codesandbox.io/p/sandbox/gh-6426-rhlwdn? You can also check that if you have declared multiple algoliasearch related packages, that they target the same version (but you only need |
Also facing this, I have: "react-instantsearch": "7.13.9",
"algoliasearch": "5.18.0", Client imported like: import { algoliasearch } from 'algoliasearch';
export const searchClient = algoliasearch(...) Error:
|
in some configurations of typescript (not sure which ones yet, as I haven't been able to reproduce) only algoliasearch lite is supported (just the types, the code always works):
|
@Haroenv It seems in v5, algolia/lite isnt a thing anymore though? |
it still is, we use it in our examples:
|
@Haroenv ahh, youre right, probably just needed to restart tsserver! Any ideas about all the errors relating to react 19 and "'InstantSearch' cannot be used as a JSX component."? |
Same issue after upgrading. Seems like |
Hey @JClackett this should be solved with #6520, you can test by installing it with this :
Couldn't reproduce the |
🐛 Current behavior
I upgraded JavaScript API Client to version 5.13.0 successfully, but it is not compatible with
InstantSearch
component from react-instantsearch anymore.This is the code:
The error is type related saying
is not assignable to type 'SearchClient'
Is
react-instantsearch
going to be updated soon to support algolia v5?🔍 Steps to reproduce
Live reproduction
https://www.algolia.com/doc/libraries/javascript/v5/upgrade
💭 Expected behavior
InstantSearch
component shouldn't give any errors.Package version
algoliasearch 5.13.0, react-instantsearch 7.13.7
Operating system
Mac OS 15.0.1
Browser
Chrome
Code of Conduct
The text was updated successfully, but these errors were encountered: