startsWith causes error in IE10
emuvente opened this issue · comments
Console error in Internet Explorer 10, Windows 7, visiting https://www.kiva.org/algolia-vue
Object doesn't support property or method 'startsWith' search-insights@1.0.0, line 1 character 13668
The code at that position:
...t&&""!==t&&t.startsWith("anonymous-")?this._userTok...
Looks indeed like this needs a polyfill: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
We shouldn't have to use polyfills in this project. indexOf
would work:
'anonymous-token'.indexOf('anonymous-') === 0
// => true
We'll make sure to update this, thanks for reporting. In the meantime, you can use the polyfill that @Haroenv mentioned.
this was fixed in #129