New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prepareHost is being called with an array; results in t.toLowerCase is not a function error #560
Comments
Upon closer inspection, the problem is that here, the value of this.hosts.read (2) ["07QFUIN3KT-dsn.algolia.net", Array(3)]
this.hosts.write (2) ["07QFUIN3KT.algolia.net", Array(3)] whereas it is clear from the rest of the code that it should be a flat list. |
Turns out it is Babili issue. Here is the relevant bug report: Basically, it breaks how algoliasearch-client-javascript/src/AlgoliaSearchCore.js Lines 98 to 99 in ebac754
|
Wow thanks for the bug inspection, minifiers are tricky :) |
After reading that Babili issue, it’s not clear to me if that fix is already released, and upgrading helped you or are now not using babel anymore @gajus |
It is not fixed. You need to disable "evaluate" plugin. See: https://github.com/babel/babili/tree/master/packages/babel-preset-babili#options If you are using Babili via webpack, you can disable it as such: new BabiliPlugin({
// @see https://github.com/algolia/algoliasearch-client-javascript/issues/560
evaluate: false
}), |
I am not able to consistently reproduce the issue. However, somehow this part of the code:
algoliasearch-client-javascript/src/AlgoliaSearchCore.js
Lines 726 to 730 in ebac754
gets called with an array instead of a string.
I have added
console.log
:I can the first invocation:
followed by:
Weirdly, this is happening only in a webpack bundle thats minified using Babili (which makes it near impossible to debug).
The text was updated successfully, but these errors were encountered: