Skip to content

why is the instantsearch library still trying to fetch search-insights from CDN, despite being installed via yarn? #6256

Answered by dhayab
twelve17 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, are you providing the insights client to <InstantSearch>?

import { InstantSearch } from 'react-instantsearch';
import insightsClient from 'search-insights';

export function App() {
  return (
    <InstantSearch
      searchClient={searchClient}
      indexName="indexName"
      insights={{ insightsClient }}
    >
      /* ... */
    </InstantSearch>
  );
}

Otherwise, InstantSearch cannot deduce the presence of the Insights client just by it being added as a dependency, and will fallback to loading it from a CDN.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@twelve17
Comment options

Answer selected by twelve17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants