Resolve Prototype.js Interference With Typesense/InstantSearch Implementation
TLDR John reported an error after including Prototype.js library in their website, affecting the Typesense/InstantSearch implementation. Nick suggested avoiding the old library, but John couldn't due to it being required by Magento 1.9. Jason clarified the issue and suggested an upgrade. Upgrading to Prototype.js version 7.1 mitigated the issue according to John.
May 26, 2021 (32 months ago)
And as soon as I include this library it kills the Typesense/InstantSearch implementation, giving the error I pasted below.
Does anyone know how I could resolve this?
uniq.ts:2 Uncaught TypeError: Cannot read property 'indexOf' of undefined at uniq.ts:2 at prototype.js:884 at prototype.js:825 at Array.forEach (<anonymous>) at Array.each (prototype.js:824) at Array.findAll (prototype.js:883) at le (uniq.ts:2) at prepareTemplateProps.ts:26 at he (prepareTemplateProps.ts:60) at hits.tsx:42
Instantsearch.js uses the
Array.filterfunction and the modern JS implementation of it takes 3 parameters.
However, Prototype.js redefines
globally as it's own 2-argument function and that causes InstantSearch.js to error out.
Not sure if this is helpful, but may be something like this might help prevent prototype polluting the global Array object: http://perrymitchell.net/article/stop-polluting-my-prototypes/
Indexed 3015 threads (79% resolved)
Resolving Typesense Setup Issues with VueJS
A sought help with setting up Typesense in a CDN VueJS application. Jason guided him to adjust the initialization and provided a solution to an undefined item warning, resulting in a successful setup.
Contributing to project using JS, TS, Go and PHP
Troubleshooting TypeScript Error with Typesense
GM experienced an error with Typesense in TypeScript, requiring help to correct the issues. Jason helped propose solutions and adjustments to the code. Ultimately, they were able to resolve the errors and successfully implement a search function.