When I ran Algolia Search with WP Rocket I bumped into WP Rocket Algolia Search Conflict. With JavaScript Minification turned on I got several errors
JavaScript Errors
I got this error:
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (head.js.map, line 0)
as well as these:
Uncaught ReferenceError: algoliasearch is not defined at HTMLDocument.<anonymous> ((index):94) at i (a9b476399a1ace75e81cb940be005dd2.js:2) at Object.fireWith [as resolveWith] (a9b476399a1ace75e81cb940be005dd2.js:2) at Function.ready (a9b476399a1ace75e81cb940be005dd2.js:2) at HTMLDocument.K (a9b476399a1ace75e81cb940be005dd2.js:2) (anonymous) @ (index):94 i @ a9b476399a1ace75e81cb940be005dd2.js:2 fireWith @ a9b476399a1ace75e81cb940be005dd2.js:2 ready @ a9b476399a1ace75e81cb940be005dd2.js:2 K @ a9b476399a1ace75e81cb940be005dd2.js:2
and these:
SyntaxError: expected expression, got '<' ReferenceError: algoliaAutocomplete is not defined[Learn More] imwz.io:131:9
The latter two were the real culprit as a soon as these showed up the site would not load properly anymore. The files causing the issue seemed to be:
https://imwz.io/wp-content/plugins/search-by-algolia-instant-relevant-results/js/algoliasearch/algoliasearch.jquery.min.js?ver=2.8.1 https://imwz.io/wp-content/plugins/search-by-algolia-instant-relevant-results/js/autocomplete.js/autocomplete.min.js?ver=2.8.1
WP Rocket JavaScript Exclusion
Solution
Solution given by WP Rocket for the site not loading with Algolia JS minified in the end was to add this to exclude all Algolia JS:
/wp-content/plugins/search-by-algolia-instant-relevant-results/(.*).js
So that means we probably somehow missed a script besides the ones I mentioned and this one was not excluded. It is now. Happy to have this work though! Again I would prefer to go without the inline script added by Algolia, but to solve that more time would be needed.