Conflict with Algolia Search

Hi, I just uncovered a recent conflict with Algolia search where litespeed is preventing a javascript from firing on my search results page. Here's the error I see in the console when litespeed cache is on:
?s=cabernet:181 Uncaught TypeError: wp.template is not a function
    at Object.<anonymous> (?s=cabernet:181)
    at Function.each (jquery.js:384)
    at HTMLDocument.<anonymous> (?s=cabernet:180)
    at j (jquery.js:3148)
    at Object.fireWith [as resolveWith] (jquery.js:3260)
    at Function.ready (jquery.js:3472)
    at HTMLDocument.J (jquery.js:3503)
This goes away when litespeed cache is off and the search results return normally.
I'm assuming this can probably be fixed through one of the settings in litespeed but I'm not very technical so have no idea where to start. Can someone help?
Last edited by a moderator:


Staff member
A few ideas:
  • Do you have Optimize > Exclude JQuery turned OFF? If so, turn it ON and see if that fixes it.
  • Do you have Load JS Deferred turned ON? Try disabling that and see if it works. If so, you might need to exclude one of the plugin's JS files in the Tuning > JS Deferred Excludes setting.
  • Are you using JS minify, combine, or push? If so, you may need to exclude one of your JavaScript files from optimization. There's a handy wiki to help you figure out what JS file it is, and you're already a step ahead if you know to concentrate on the files associated with the Algolia plugin.
I hope one of these helps!
Thanks Lisa. Exclude Query was already turned on. (Turning it off does not fix either.)
Load JS Deferred is not on.
I am using JS minify and combine. Turning them both off fixes the problem. (Turning one or the other off does not.) Unfortunately excluding the js files from the plugin doesn't help. In fact, excluding all the js files does not help either.

For now I've just turned js minify and combine off but if you have other ideas on how to fix and still use these features I'm all ears...