I'm using Algolia search with the Magento AlgoliaSearch integration (https://github.com/algolia/algoliasearch-magento).
Now I'm facing the problem, when hitting enter in the autocomplete search as long as there are any suggestions, I receive an JS error on loading the instant search results page.
At the moment the autocomplete search returns that there are no results found, the instant search results load correctly and I'm also able to refine the search/perform a search on other terms in the searchbox on the instant results page without any issues.
I've already found out, that the problem is loading the template that is done in this line (
var wrapperTemplate = algoliaBundle.Hogan.compile($('#instant_wrapper_template').html());
As long as the autocomplete search returns any results,
$('#instant_wrapper_template').html() is undefined.
From the moment on the autocomplete search has no results the correct content contained in
$('#instant_wrapper_template').html() (defined in
algoliasearch-magento/app/design/frontend/base/default/template/algoliasearch/instantsearch/wrapper.phtml) is loaded.
I'm not sure if I'm missing something, but I hope that someone of you can help me.