Giter Club home page Giter Club logo

Comments (7)

leecobaby avatar leecobaby commented on May 22, 2024 1

@leecobaby can you verify the version of chatgpt package you're using?

Hello, I was submitting an issue with v2.0.1, but now my project is working after upgrading to v2.0.4.
Thank you so much for the fix. ๐ŸŽ‰

from chatgpt-api.

transitive-bullshit avatar transitive-bullshit commented on May 22, 2024

Thanks for the report, Leeco.

I'm guessing this has something to do with either Vercel's eager lambda bundling leaving out undici, which we import asynchronously โ€”ย or undici itself within this environment.

Needs investigation.

from chatgpt-api.

transitive-bullshit avatar transitive-bullshit commented on May 22, 2024

Related:

It's possible that the Vercel environment is polyfilling fetch with node-fetch, which would cause this error.

from chatgpt-api.

transitive-bullshit avatar transitive-bullshit commented on May 22, 2024

@leecobaby can you verify the version of chatgpt package you're using?

from chatgpt-api.

transitive-bullshit avatar transitive-bullshit commented on May 22, 2024

I have a tentative fix released in https://github.com/transitive-bullshit/chatgpt-api/releases/tag/v2.0.3

I think the issue is that Vercel's Next.js Node.js environment polyfills fetch with the non-standard node-fetch, which was breaking support for the streaming response support. I've aded a special case to test for this and handle it gracefully.

Please let me know if you're still experiencing issues after upgrading to latest.

from chatgpt-api.

transitive-bullshit avatar transitive-bullshit commented on May 22, 2024

Update: I meant v2.0.3. There was a problem with v2.0.2.

from chatgpt-api.

transitive-bullshit avatar transitive-bullshit commented on May 22, 2024

That's great to hear ๐Ÿ’ช

I've also verified that the package works as expected using both next dev locally as well as when deployed to Vercel as a serverless function. I haven't tried it out on edge functions yet.

from chatgpt-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.