Open bitttttten opened 1 month ago
The most interesting part to reproduce would be the part where you're using connectAutocomplete. I wonder if it's possibly rendering conditionally and therefore at some timing where there's no results? It's odd because this is in a loop with the scopedResults array which therefore is definitely present, but it seems to imply that one of the results
is null
. Could this maybe be an adjacent index widget which is rendered conditionally as well?
We could guard for the case but I'd rather find out why results is null before, maybe something larger is wrong?
What could help you here? Shall I share some more of our set up code?
a minimal reproduction that shows the issue is the most efficient way for us to dig down.
🐛 Current behavior
We see that on Sentry we get a lot of the error "Cannot read properties of null (reading 'hits')".
It's hard to investigate for us as the stack trace leads us from
../../../../node_modules/instantsearch.js/es/connectors/autocomplete/connectAutocomplete.js in indices at line 63:84
to../../../../node_modules/instantsearch.js/es/lib/utils/defer.js in progress at line 18:16
.Our dependencies are:
This project is not using nextjs, but we are in a monorepo and so are sharing some packages. We are just importing from
react-instantsearch
for things likeuseInfiniteHits
,useHits
,useRefinementList
, theConfigure
component.We have about 26 files using react-instantsearch so I'm happy to share some code examples although it's hard for us to know which part is causing the issue. So I wanted to open this issue incase it is a library bug. Happy to try and work through to understand if it's userland or not.
🔍 Steps to reproduce
Live reproduction
n/a
💭 Expected behavior
No error is thrown
Package version
react-instantsearch@7.5.5
Operating system
No response
Browser
No response
Code of Conduct