-
Notifications
You must be signed in to change notification settings - Fork 60
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
Use an isomorphic fetching library #456
Comments
A library like |
It looks to me like |
You can specify your own That can alleviate some of your concerns and allow you to use the proper fetch |
From the error message, it seems the bundler is complaining about importing I guess you’re using Netlify edge functions, which support importing absolute path. esm.sh replaces |
we don't want to add an isomorphic fetching library as dependency because it would massively increase the bundle size. We want to stay close the web platform, as that's where all the JS runtime environments gravitate towards. |
That probably is the best way to go. The only reason that I mention this issue is that I was having trouble with |
an alternative, if you only use |
I'm using |
@gr2m That sounds like a great idea! That would fix a ton of issues and make oktokit compatible with many more runtimes! When do you want to ship this change? Do you want me to create a PR? |
It would be a breaking change, so best to coordinate with other breaking changes as needed. I would say to wait for the ESM rewrite, however that seems to be on standby currently. Feel free to send a PR and we can go from there |
@wolfy1339 I created PR #580 |
The dependency on node-fetch also makes this package difficult to include in Next.js projects deployed to Vercel. Here's the error I get:
Removing the dependency on node-fetch should fix it. Edit: Can confirm when I patched out the import to node-fetch then the build succeeded. |
🎉 This issue has been resolved in version 7.0.0-beta.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This can be closed now that #580 landed |
Let's keep it open until it reaches the final stable release |
it will be closed once |
🎉 This issue has been resolved in version 7.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I've recently been trying to use an edge environment to deploy a project of mine, and the main error that I get is:
Cannot bundle Node.js built-in "stream" imported from "node_modules/@octokit/request/node_modules/node-fetch/lib/index.mjs"
. However, edge environments do not support Node.js, even though I believed this was an isomorphic library. Apparently,node-fetch
is not isomorphic. I don't know how hard this would be or how much time it would take, but I could also open a PR if necessary.The text was updated successfully, but these errors were encountered: