-
Notifications
You must be signed in to change notification settings - Fork 106
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
fix: use existing fetch if it exists, otherwise fallback to whatwg-fetch #138
Conversation
I'm not sure why the code was written the way it is, but it appears to be forcing the polyfill to be used even in environments where the Fetch API exists natively, which isn't intentional and causes the bugs described in lquixada#91, lquixada#78, and lquixada#69. The original commit and PR don't describe why the behaviour was changed: lquixada@123b1a2
This will need a build done on this branch, since you're committing the build artifacts to the repo too. |
We import it conditionally anyway and cross-fetch has an issue where it's used even in environments where fetch exists natively, see lquixada/cross-fetch#138
We import it conditionally anyway and cross-fetch has an issue where it's used even in environments where fetch exists natively, see lquixada/cross-fetch#138
We import it conditionally anyway and cross-fetch has an issue where it's used even in environments where fetch exists natively, see lquixada/cross-fetch#138
Is there any update on the above PR @ThisIsMissEm @jpwilliams ? |
We're ditching cross-fetch for our own package that works for our use case better, it'll be released soon. |
isomorphic-fetch uses the same browser polyfill as cross-fetch and therefore returns the same error. isomorphic-fetch will be removed as a dependency in the next commit. Related pull request that was never merged: lquixada/cross-fetch#138
Any updates here? This is blocking a lot of AI Provider's SDKs from working on Vercel and Cloudflare Workers. |
My former employer, Inrupt, has released a replacement called edit: I'm not sure if it's fetch detection will work 100% out of the box on Cloudflare Workers or Vercel Functions, but I think it should, and they'd probably appreciate patches if it doesn't work on those platforms. Might be worth a look. |
c7aa351
to
5e3d301
Compare
hi @ThisIsMissEm. thanks for taking the time to work on this PR. I'm closing this in favor of #163 . |
I'm not sure why the code was written the way it is, but it appears to be forcing the polyfill to be used even in environments where the Fetch API exists natively, which isn't intentional and causes the bugs described in #91, #78, and #69.
The original commit and PR don't describe why the behaviour was changed: 123b1a2