-
We've got a nextjs FE app that has some CSP policies defined. We've got the following libraries installed via yarn:
On a production build, we're seeing a "blocked:csp" error: it looks like one of the Algolia libraries is trying to download https://cdn.jsdelivr.net/npm/[email protected]/dist/search-insights.min.js It fails due to our CSP policy. But it is odd that it is even trying to download it, since we have it installed locally. We really do not want to get the libraries from a CDN. Anyone else run into this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, are you providing the insights client to 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. |
Beta Was this translation helpful? Give feedback.
Hi, are you providing the insights client to
<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.