You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
url
os
assert
util
stream
events
worker_threads
diagnostics_channel
async_hooks
perf_hooks
http
net
zlib
console
tls
net
querystring
http
https
Here is where they occur in the client (via my build/deploy errors):
lib/sniffingTransport
lib/client
lib/Diagnostic
lib/Serializer
lib/pool/BaseConnectionPool
transport/lib/transport
.... many others
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:
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.
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.
馃殌 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: