Cloudflare Workers and algoliasearch JavaScript problem

Has anyone here tried to use the algoliasearch JavaScript client SDK inside a Cloudflare Worker? Most functionality doesn’t seem to work when running with wrangler dev path/to/file but when adding the --local option they do all of a sudden. Getting the following error on just calling client.listIndices().

Also contacted Algolia support about this but was just wondering if anyone has experience with this.
Initializing the client with the fetchRequester that was introduces in v4.14.0.

            "request": {
                "headers": {
                    "x-algolia-api-key": "*****",
                    "x-algolia-application-id": "*****",
                    "content-type": "application/x-www-form-urlencoded"
                },
                "method": "GET",
                "url": "https://<application-id>-3.algolianet.com/1/indexes?x-algolia-agent=Algolia%20for%20JavaScript%20(4.14.2)%3B%20Browser",
                "connectTimeout": 1,
                "responseTimeout": 2
            },
            "response": {
                "status": 0,
                "content": "The 'mode' field on 'RequestInitializerDict' is not implemented.",
                "isTimedOut": false
            },
1 Like

I can’t get the algoliasearch JavaScript client going at all. Did you find a working workaround?

Hey @vrogg and @jeroen, I’ve also encountered this issue so I’m trying to add a fix for it in this PR: FEAT: Removing Mode for CloudFlare Workers by OLingard · Pull Request #1452 · algolia/algoliasearch-client-javascript · GitHub