I'm currently using the Algolia JS API but for some reason I keep randomly getting the following error in console:
UncaughtUncaught syntax error unexpected token u in JSON at position 0
My current code looks like this:
var params = {
hitsPerPage: 10,
page: 0,
facets: '*'
}
index.search('some search term', params, function load_search_products_callback(err, content) {
console.log(content);
});
The problem is that the error occurs before the console.log(content)
part of the code is run, so I'm unable to actually what the problem is or where it's happening.