Web algoliasearchLite.min.js fails with protocol error

Web init

client = algoliasearch('....', '...');
index = client.initIndex('items');

Error collected from Sentry

AlgoliaSearchError
protocol must be `http:` or `https:` (was `undefined`)
/npm/algoliasearch@3/dist/algoliasearchLite.min.js in r at line 3:3051
/*! algoliasearch 3.24.12 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define {snip}
{snip} nt-javascript/wiki/Deprecated#"+o}},{}],24:[function(e,t,o){"use strict";function r(t,o){var r=e(4),n=this;"function"==typeof Error.captureS {snip}
/npm/algoliasearch@3/dist/algoliasearchLite.min.js in r at line 2:17810
/npm/algoliasearch@3/dist/algoliasearchLite.min.js in a at line 2:30423
/npm/algoliasearch@3/dist/algoliasearchLite.min.js in s at line 2:30395
/main.b558d6bd19ec2fe793c4.bundle.js in errO at line 1:854820
/inline.d2fdac7743d55d0f1888.bundle.js in o at line 1:412
/main.b558d6bd19ec2fe793c4.bundle.js in uf3d at line 1:962194
/inline.d2fdac7743d55d0f1888.bundle.js in o at line 1:412
/main.b558d6bd19ec2fe793c4.bundle.js in x35b at line 1:984137
/inline.d2fdac7743d55d0f1888.bundle.js in o at line 1:412
/main.b558d6bd19ec2fe793c4.bundle.js at line 1:44882
/inline.d2fdac7743d55d0f1888.bundle.js in o at line 1:412
webpackJsonp@https://superb-ascent.appspot.com/inline.d2fdac7743d55d0f1888.bundle.js at line 1:283
/main.b558d6bd19ec2fe793c4.bundle.js in global code at line 1:13

Very intermittent. See on Mobile Safari and Chrome. Any thoughts?

Hi there,

We published a bad fix on our JavaScript client (that you are using) that triggered this issue on your side. Sorry about that.

We have published a new version but it takes time to propagate to Algolia scripts inserted like ,
it is currently being propagated and your website should be working again in the coming minutes.

In the meantime, as a better fix, can you update your website scripts so that you change:

By doing so you will ensure that if it’s working right now it will always be working because there won’t be anymore any auto update to your website.

On behalf of Algolia I apologise for this current issue and hope you can update your code accordingly for this to never happen again.

Let me know if you have further questions.

1 Like