algolia / unified-instantsearch-ecommerce

The fastest way to implement Algolia, for e-commerce customers.
https://unified-instantsearch-ecommerce.netlify.app
Apache License 2.0
32 stars 51 forks source link

The `inputContainer` option must refer to a valid HTML element. #177

Closed krishnaapatel closed 2 years ago

krishnaapatel commented 3 years ago

search.js:4 Uncaught Invariant Violation: The inputContainer option must refer to a valid HTML element. at e.exports (http://localhost:4200/scripts.js:11564:68786) at http://localhost:4200/scripts.js:11564:273517 at Array.forEach ()

I am facing this issue while integrating with angular app. I know what is issue, I have created div element with id "search-button" in app component. But, It is native element not the HTML element. so, this error appear. Can anyone please help me how to use in angular component?

I have exported unified-search application and imported search.js and search.css in angular.json file.

francoischalifour commented 3 years ago

What do you pass to inputContainer? You may need to defer Unified InstantSearch until Angular has built the DOM.

krishnaapatel commented 3 years ago

What do you pass to inputContainer? You may need to defer Unified InstantSearch until Angular has built the DOM.

Thanks for your response. I have just created div with "search-button" id and unified search will pick that element as inputContainer. Though, when I put that div element in index.html, It is working. But, When I put that div in component html file. It is not working. Yes, It seems I need to modified unified InstantSearch.