Closed hauph closed 4 years ago
I consoled the whole react-searchkit source in my app (I installed it via npm) and I saw an object module which includes ESSearchAPI, but when I consoled ESSearchAPI, it showed undefined.
I even checked the whole react-searchkit source code folder and I found ESSearchAPI is exported, so it should be ready to use. ESSearchAPI is existed, then why can't I call it out and use it on front-end?
This is just crazy!!
OMG I know what's wrong. In your documenation, you wrote:
const searchApi = new ESSearchAPI({
url: 'https://my.es.backend.org/search/',
timeout: 5000
});
class App extends Component {
render() {
return (
<ReactSearchKit searchApi={searchApi}>
...
</ReactSearchKit>
)
}
}
What's wrong here is it should be ESSearchApi, not ESSearchAPI. Just a typo but it has driven me crazy for 3 hours @@.
Thanks for reporting. I've fixed it in the docs now so others won't have the same problem.
Hello,
I followed this instruction to connect ElasticSearch to react-searchkit, and my configuration was as follow:
However, it did not succeed and instead I received the following error:
index.js:120 Uncaught TypeError: react_searchkit__WEBPACK_IMPORTED_MODULE_16__.ESSearchAPI is not a constructor
Can anyone please tell my what I did wrong here? I would be truly grateful for any help.