Code Monkey home page Code Monkey logo

Comments (6)

titouv avatar titouv commented on May 27, 2024 2

Seems like this issue is known in the Bun repo oven-sh/bun#6969 (comment) (fix in oven-sh/bun#6468 but not yet merged)

Maybe it could be considered to add a temporary fix here because fixing this type of bug doesn't seem to be a priority for bun maintainers. Also because it is a major bug making the library unusable with bun.

from openapi-typescript.

drwpow avatar drwpow commented on May 27, 2024 2

Ah glad to see they are fixing it! In the upcoming 0.9.0 (which will likely have some very minor breakages), I decided to remove all internal response.clone()-ing because it can be a performance bottleneck. I’d love for consumers of openapi-fetch to just learn to call response.clone() themselves when needed (most people won’t ever need to, and for advanced usecases it’s better to learn about the native fetch API than shielding you from it).

from openapi-typescript.

sdekna avatar sdekna commented on May 27, 2024 1

I experienced this when using Bun. There is a pull request that should fix this and should be merged soon hopefully:
oven-sh/bun#8668

A quick workaround meanwhile:

  • open ./node_modules/openapi-fetch/dist/index.js
  • replace const cloned = response.clone() with const cloned = response

from openapi-typescript.

mihon73 avatar mihon73 commented on May 27, 2024

openapi-fetch 0.8.2
bun 1.0.16

from openapi-typescript.

titouv avatar titouv commented on May 27, 2024

Getting the same error with a bearer authorized request if that can help

from openapi-typescript.

titouv avatar titouv commented on May 27, 2024

After investigating it seems the problem is from the clone before getting the json from the body (at least in my case), removing the cloning (and probably breaking other functionalities) works for me.

from openapi-typescript.

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.