FEAT: Removing Mode for CloudFlare Workers#1452
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 7047b5f:
|
shortcuts
left a comment
There was a problem hiding this comment.
ran everything locally and it works! thanks :D
|
hello! wanted to ask a clarifying question: does this PR enable Cloudflare Workers 100%, no other workarounds etc? Separately, noticed there's a new beta version of the JS library, will that include this fix or has the beta not necessarily been tested on Workers platform yet? Thanks in advance! |
|
Hey!
I believe so, but if not feel free to submit an issue and we would be more than happy to resolve it :)
It have already been removed from the new beta version (v5), and the requester is exactly at the same stage as this one, however I don't know if people already tested it on workers |
|
thanks so much! |
Description
When trying to use Algolia's
requester-fetchpackage combined with thealgoliasearchmethod on Cloudflare workers, we get the errorThe 'mode' field on 'RequestInitializerDict' is not implemented.. For reference CF workers are ran in V8 Isolate and they have not added an implementation for mode on their fetch runtime.Although it's not ideal that the behaviour of CloudFlare is to throw an error, we can avoid this issue by removing the mode field from the
requester-fetchfetch options. The default mode iscorsanyway so there is no functional change.This issue has surfaced for multiple people as seen in this forum.
Reasons
I looked at the other request packages but they do not fit the bill.
requester-node-http: CF workers are ran in a browser environment not noderequester-browser-xhr:XMLHttpRequestis not implemented on CF workers.