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
We did set up Algolia search autocomplete with the help of @algolia/autocomplete-js. It is quite similar to what is defined in the query suggestions sandbox example from your docs.
It is rolled out in one of our services and works, however we are noticing cryptic errors coming from the library code.
We cannot reproduce it and it happens quite occasionally.
Sentry gives us the following traceback:
TypeError: Cannot read properties of null (reading 'item')
at <anonymous>(./node_modules/@algolia/autocomplete-core/dist/esm/onKeyDown.js:116:20)
at <object>.onKeyDown(./node_modules/@algolia/autocomplete-core/dist/esm/getPropGetters.js:179:9)
at <object>.onKeyDown(./node_modules/@algolia/autocomplete-js/dist/esm/elements/Input.js:36:18)
at eventProxy(./node_modules/@algolia/autocomplete-js/dist/esm/utils/setProperties.js:30:25)
The function getCollectionFromActiveItemId attempts to find the collection containing the active item based on the activeItemId. If no collection contains this item, the function returns undefined, leading getActiveItem to return null
Similarly, if the activeItemId is invalid the function can fail to find the active item and return null.
Possible Fix
By Validate activeItemId Before Using It.
Null Check in Calling Code: In onKeyDown.js and other places where getActiveItem() is used.
I would like to open a PR for this issue. Could you please assign it to me? @Haroenv
Description
Greetings dear fellows.
We did set up Algolia search autocomplete with the help of
@algolia/autocomplete-js
. It is quite similar to what is defined in the query suggestions sandbox example from your docs.It is rolled out in one of our services and works, however we are noticing cryptic errors coming from the library code.
We cannot reproduce it and it happens quite occasionally.
Sentry gives us the following traceback:
Reproduction
Couldn't yet.
Expected behavior
No errors coming from the library.
Environment
The text was updated successfully, but these errors were encountered: