Giter VIP home page Giter VIP logo

Comments (4)

Uzlopak avatar Uzlopak commented on July 20, 2024

PassThrough Stream is a Duplex Stream, which also implements a ReadableStream. But maybe it is not a Webstream

Does it happen when using deflate/inflate as compression?

from undici.

flakey5 avatar flakey5 commented on July 20, 2024

I don't believe there's compression happening. The transfer encoding is chunked

from undici.

KhafraDev avatar KhafraDev commented on July 20, 2024

Would you be able to share what dependency is using undici? It's unlikely to be an issue here.

from undici.

flakey5 avatar flakey5 commented on July 20, 2024

Aghh I've figured out the problem and it's not Undici. We utilize an api client to contact another service. Upon importing it, it checks if it's in a browser. If it's not, it overrides the global fetch to be node-fetch. Only one of the configurations causes us to use this client and we dynamically import it then. Since the tests and the service are running within the same Node instance, that means the calls to fetch() in the tests started using node-fetch's implementation after we tested that configuration. So, the order of things was basically:

  • Configuration A endpoint test
    • globalThis.fetch is still Undici
    • Test passes just fine
  • Configuration B endpoint test
    • globalThis.fetch is still Undici
    • Api client is imported
    • globalThis.fetch is now node-fetch
    • Test passes just fine somehow?
  • Configuration C & D endpoint tests
    • globalThis.fetch is node-fetch
    • Tests fail, mocks aren't present, this issue pops up, etc.

In retrospect this probably should've been a bit more obvious to me haha 😅

Closing now, thank y'all for your assistance!

from undici.

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.