-
Notifications
You must be signed in to change notification settings - Fork 36
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 Edge environments #146
Comments
@lopezjurip Thanks for this issue—I wasn't aware that those edge platforms didn't implement those node modules. Support for this, while being backwards compatible with the latest LTS, seems a bit tricky. Are you aware of any packages that make http requests that support both native node.js and edge platforms? What does the error look like when using this? |
I would also really like to see edge support in this library. I am currently using the web API directly to workaround this. @mike-engel - fetch is natively supported in all edge runtimes and also natively supported in Node 18 and higher: https://nodejs.org/en/blog/announcements/v18-release-announce#fetch-experimental It can be polyfilled to older Node versions using this library: https://github.com/node-fetch/node-fetch/tree/main A native implementation can simply be checked for and polyfilled if not present, like done here: https://github.com/lquixada/cross-fetch/blob/v4.x/src/node-polyfill.js It looks like this project would need a big overhaul to replace http with fetch, but working in all JS environments is really important future proofing! |
And we are now past the EOL for Node 16, so no polyfill needed if you minimally support Node 18 and higher: https://nodejs.dev/en/about/releases/ |
+1 on wanting a library that can run on edge. Any update on this? Would this ever be prioritized? @mkcode - do you have any code for using the web API directly that you could share? |
This project relies on the native "http" / "https" modules from Node.js which are not compatible on Edge environments such as Cloudflare Workers, Next.js Edge Routes / middleware nor AWS Lambda Edge.
I would recommend a version built on top of "fetch" witch is getting a native Node.js implementation.
The text was updated successfully, but these errors were encountered: