-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-fetch
package combined with thealgoliasearch
method 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-fetch
fetch options. The default mode iscors
anyway 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
:XMLHttpRequest
is not implemented on CF workers.