TypeError: instantsearch.widgets.trending Items is not a function

Hi Everyone ,

I am trying to fetch and display the trending items on the instant search UI like a carousal but its giving this error in the console.

" TypeError: instantsearch.widgets.trending Items is not a function "

NOTE: trending model is already trained in Algolia account and can see the results in the preview tab

instantsearch.widgets.trendingItems({
container: ‘#trendingItems’,
templates: {
item(recommendation, { html }) {
return html <h2>${recommendation.name}</h2> <p>${recommendation.description}</p> ;
},
},
}),

Are you creating a custom widget like? Create your own InstantSearch.js widgets | Algolia

Or is this from something else?

I am following this trendingItems | InstantSearch.js | Algolia

1 Like