How to debug issues with widgets not showing expected possible refinements

I am currently trying to add some widgets to our InstantSearch component. However the widgets are not showing up on the page. They are in the DOM tree, however it seems they think that there is no possible refinement, so they render empty. I have the same widgets, same index in a separate codebase where it works perfectly fine. The primary differences are that one uses SSR and has other code, and the other doesnt

My question is how do I best go about debugging these sorts of issues, where widgets should be showing possible refinements, but arent?
I’ve looked into the context and the widgets are definitely being registered thru checking the context.widgetManager.getWidgets(). The fact that multiple different widgets aren’t showing in the one codebase makes me think theres something wrong about my setup.
Is there a place I can look for documentation on the context used by react-instantsearch, as I would like to understand the internals better to debug this issue?

Specifically my Toggle, SearchBox, CurrentRefinements widgets are working in the one codebase, but RefinementList, HierarchicalMenu, Menu widgets arent. In the codebase forked from the react-instantsearch examples I am able to get all of these working. My items prop is consistently [] when I expect it to have items

So it seems one state has disjunctiveFacets and hierarchicalFacets and in the other they’re empty arrays. But then _state does have disjunctiveFacets… Whats the role of _state?

1 Like

I found the issue: passing an empty resultsState object to InstantSearch was causing things to not work as expected and excluding collections from Lodash in my webpack build was causing another error.

1 Like

Hi @david1,

Indeed it seems that on our side, empty resultsState is not well manage and causes an undefined exception. Can you confirm this behaviour?

Also, did you fix your website? Can you tell us what you did?

Thanks!