-
Notifications
You must be signed in to change notification settings - Fork 730
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
Support Cloudflare Workers / Vercel Edge Functions #2032
Comments
Thanks for listing out all of those unsupported areas of the code, @kelbyfaessler. Super helpful when addressing requests like this. At present, support for edge workers isn't on our short-term roadmap, but we have put some similar items on the list for consideration. Deno support came up in #1742, where the request is to decouple the client from core Node.js APIs. As requests like this come in, our justification for prioritizing the work to do this will definitely grow. ping @srikanthmanvi for visibility |
This is definitely needed! With server-side-rendering systems like Nuxt or Next, people rely on edge functions to connect to elastic search. Unrelated Complaint: I spent the last week building my Nuxt application using this library, only to find out when I deploy, nothing works because it doesn't have support for cloudflare workers. It was also a debugging nightmare because the error messages were cryptic. It took me around 3 hours to finally realize that this library does not support edge functions. Now, I have to rewrite everything using painful HTTP requests... |
@johnomeara1 Can you give some hints as to how this failed on Nuxt? Perhaps there's an opportunity to at least make the errors more useful until we can add edge support. |
This issue is stale because it has been open 90 days with no activity. Remove the |
We determined in #2341 to not pursue this in the short term. I'd like to explore the possibility of a "Web" client that uses only Web APIs and thus supports most edge compute environments. We have also discussed the potential of e.g. providing a WASM build of the new Rust client as it reaches maturity, possibly providing JS bindings for it. |
🚀 Feature Proposal
This client doesn't currently work in apps deployed on cloudflare workers and Vercel edge functions because these environments don't support all node APIs, and your client uses some of these unsupported APIs. It would be nice if there was either a more minimal client without these dependencies, or if we had the option to not install some client features in order to remove these dependencies.
Motivation
These deployment options are becoming increasingly popular and you'll probably increasingly have people asking about it. For example, here's an issue where a couple people were discussing this problem and the only solution was to abandon the client and make raw HTTP requests instead.
Example
Here are some of the unsupported nodejs APIs:
Here is where they occur in the client (via my build/deploy errors):
But is all of this stuff really necessary for a client that's a wrapper around a REST API? Or if so, could I opt into only the things I actually need so I don't need to bundle all this stuff in my build?
The text was updated successfully, but these errors were encountered: