-
Notifications
You must be signed in to change notification settings - Fork 26
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
No fetch implementation found #53
Comments
You have to install node-fetch and pass it in as The library originally shimmed this for you, but us having node-fetch in the bundle made it toxic for Edge environments so you have to pass it in. It's tested against this though, so if you just pass in node-fetch you'll be OK. See tests ( openai-streams/test/streams.test.ts Lines 250 to 256 in f98e6b1
|
Thanks for the quick response. That fixed the issue and it resurfaced another issue. ReferenceError: ReadableStream is not defined I couldn't find this in the tests file you shared. Is this a common error mode as well? |
You have to use |
I'm currently using Thanks for the idea on upgrading node. You are right. I will make that upgrade soon. |
Sorry, that was actually my mistake, I edited my response - That being said, if you're getting that error from |
Can you post a repro using Replit if you have time? Also what version of Node are you on (presumably 14)? |
Machine info Node version: v16.16.0 Code
Error Message ReferenceError: ReadableStream is not defined |
Even after switching from |
Upgraded my node version to 17. There's some issue with moving to version 21 on my machine right now. |
Issue resolved? We'll get you up and running and add tests if needed |
If you're on 16, you can probably just use it normally again. See if
If you see it, just try the library how it comes out of the box, without custom
|
Looks like I don't have it on v17.0.0. I will try updating to 18.8.0 to see if that solves the issue. |
The OS on my machine doesn't allow upgrading to a higher version of node at the moment. Is there a way to resolve this issue without upgrading my OS? |
I'll try to dig into this later. Sorry it's been such a pain for you to use. You're on a pretty modern version of Node and this is meant to work for your use case. It's weird |
Hi,
Thanks for building this great project.
When I deployed the changes using the CJS implementation to my machine, it surfaced an error
Error: No fetch implementation found.
After doing some reading, it seems like I have to install the node-fetch library and import that into the openai-streams library fetch call somehow.
Is there a clean way for doing this?
The text was updated successfully, but these errors were encountered: