Deploying Typesense-instantsearch-adapter in Serverless Context
TLDR Emin ran into problems deploying a webpage using Typesense with CloudFlare due to axios' incompatibility with serverless contexts. Jason suggested a workaround and mentioned that axios might add a fetch-based adapter in the future. Emin agreed to implement the workaround and contribute a PR.
1
Apr 28, 2022 (20 months ago)
Emin
03:30 AMMy problem is that I can't use the typesense-deno fork mentioned in that thread since Typesense-instantsearch-adapter doesn't allow me to pass in a custom searchClient implementation. Now I could use typesense-deno and fork the adapter to use that library instead, but before I do that I was wondering if moving away from axios towards something like cross-fetch is a possibility?
Jason
04:48 AMJason
04:49 AMJason
04:50 AMJason
04:54 AMInteresting. You mean the typesense-js library right? This should be doable by changing this line to accept a typesenseClient from
options
if it is specified.I'd be open to a PR to do that
Emin
05:36 AMI'll open a PR to be able to override the client, the only problem is that I'd have to maintain an axios-less fork of typesense-js. But according to this it seems like axios is planning to add a fetch-based adapter anyway, so I'll just do it this way for now until they release that. I think I'll be able to get the PR out on Friday 🙂
1
Typesense
Indexed 3015 threads (79% resolved)
Similar Threads
Implementing State Export Feature Using Typesense InstantSearch.js on Node.js Backend
Kyle needed help passing search state to backend for implementing an "Export" feature, while using Typesense InstantSearch. Jason provided multiple solutions including advice on using Typesense InstantSearch adapter. The issue was resolved after some iteration.
Troubleshooting TypesenseInstantSearchAdapter without Node.js
John wanted to use TypesenseInstantSearchAdapter without Node.js. Jason helped by instructing to reference dist files directly, then fixing a bug that caused errors when doing so.
Issues with Typesense Frontend Search Integration
Akash experienced issues integrating Typesense into their frontend search, particularly with their search box. Jason guided them to troubleshoot, eventually identifying the issue to be with react-instantsearch-dom and suggesting a downgrade to react 17, which resolved the issue.