Git Product home page Git Product logo

Comments (5)

stephen-willoughby avatar stephen-willoughby commented on May 16, 2024

For old node

{"foo":"bar"}
complete

Process finished with exit code 0

for node 20.11.1

Process finished with exit code 13

from got.

sindresorhus avatar sindresorhus commented on May 16, 2024

Does it work without Nock? If yes, then the issue is definitely Nock as it should work with anything that normally works without it.

You can replace Nock with https://httpbin.org for testing.

from got.

stephen-willoughby avatar stephen-willoughby commented on May 16, 2024

Yes, it works without nock, replacing it with https://httpbin.org/post, but similarly nock works with axios in place of got.

from got.

masontikhonov avatar masontikhonov commented on May 16, 2024

@sindresorhus I tend to agree that it might be an issue with Got, in particular with asPromise(request), which returns promise that never resolves in some rare conditions (changes to streams that were done in node v20.10.0 + some nock behavior).

from got.

aduh95 avatar aduh95 commented on May 16, 2024

FYI patching Nock source the following way resolved the issue for me:

index d82c2446b540759cbc54ad7b26222a80109b8ec9..bf24add845d12e436c97b3ea5e2e38f87b77d489 100644
--- a/lib/intercepted_request_router.js
+++ b/lib/intercepted_request_router.js
@@ -68,7 +68,7 @@ class InterceptedRequestRouter {
     // For parity with Node, it's important the socket event is emitted before we begin playback.
     // This flag is set when playback is triggered if we haven't yet gotten the
     // socket event to indicate that playback should start as soon as it comes in.
-    this.readyToStartPlaybackOnSocketEvent = false
+    this.readyToStartPlaybackOnSocketEvent = true

     this.attachToReq()

from got.

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.