Instantsearch Conditional Display: too much recursion

I’m trying to implement a no-results display.
I’m using this guide:

I tried both the single index and multi-index solutions. I copied and pasted the examples directly to create the <Results> and <AllResults> containers. The error I get on firefox is too much recursion.

The console gives me a stack trace with the message:

The above error occurred in the <AlgoliaStateResults(UnknownComponent)> component:
    in AlgoliaStateResults(UnknownComponent) (created by Context.Consumer)
    in ConnectorWrapper (created by AlgoliaSearch)
    in div (created by AlgoliaSearch)
    ... etc ...

I am using Next.js (9.1.3) and React Instantsearch (algoliasearch version ^3.35.1, react-instantsearch-dom version ^6.0.0). I suspect that Next.js isn’t contributing to the issue here, as the problem is not SSR-only.

My component looks exactly like the one in the example above. I have no other errors. What can I do to begin debugging this issue? What is the cause?

Hi @kevin2,

We invite you to take one of our boilerplate sandboxes and update it for the minimum code needed to reproduce your issue:

This will allow us to possibly see it live and better understand what’s going on.

Right, sorry. For me, the error only appears in the browser console, and not CodeSandbox’s console. It is easiest to trigger the error by typing in the search box.

Also, I humbly suggest that the list of templates includes a Next.js template. :slight_smile: I used this one to make the above example.

This is an error in the fast-deep-equal dependency that we use which couldn’t deal with circular dependencies in React props.

I sent a PR to change the dependency. You can expect the next React InstantSearch version to fix your app.

Thank you for reporting.

1 Like