-
Notifications
You must be signed in to change notification settings - Fork 87
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
Fetch shim breaks in vercel edge environment #41
Comments
Which version of the library are you using? Can you share a full code sample, along with your vercel config? |
Latest version of this lib. Here's a codesandbox to repro: Go to When runtime is set to If you change the runtime to One weird thing is - if I run another simpler prompt (like the one I commented out), it will still work in the |
I think @jaredpalmer is looking into adding Anthropic support to Vercel edge streaming as part of their AI push. I wonder if they ran into similar issues. |
Last update - overriding the Wrong length calculation on this line: The reason why it fails on |
Thank you so much for the repro and the terrific debugging here, @dzhng ! We'll aim to get a fix out for this today. It may be a little complicated since |
I think in the non-node case using Web API |
Yes from the |
This should be fixed in Please try it out and let us know if your issue is resolved! |
When I'm using this SDK in a Vercel edge function, on LOCAL only, the request will refuse to send with the below error.
If I change the function back to nodejs environment, it works. OR, if I deploy the actual edge function (e.g. running on the real edge env, not the local one), it will also work.
IMO it's probably as much a Vercel issue as it is an issue with this SDK, but an easy way to fix is to just let users be able to define their own
fetch
implementation. I see that you already have the property for it incore.js
, just add it as an option in the constructor.The text was updated successfully, but these errors were encountered: