Skip to content
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

Failed to write to a request stream: stream does not exist with dd-trace #2373

Open
4 tasks done
marouanekadiri opened this issue Nov 28, 2024 · 0 comments
Open
4 tasks done
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node

Comments

@marouanekadiri
Copy link

marouanekadiri commented Nov 28, 2024

Prerequisites

Environment check

  • I'm using the latest msw version
  • I'm using Node.js version 18 or higher

Node.js version

v20.18.0

Reproduction repository

N/A

Reproduction steps

const { setupServer } = require('msw/node');
const tracer = require('dd-trace');

const sleep = (ms) => new Promise((r) => setTimeout(r, ms))

const main = async () => {
    const handlers = []
    const server = setupServer(...handlers);
    
    server.listen({
        onUnhandledRequest: 'bypass'
    });

    tracer.init({
        logInjection: true,
        runtimeMetrics: true
    })

    await sleep(50000)

}

main();

Just by running this simple node script I managed to reproduce it.
I'm using [email protected]

Current behavior

It is currently failing with Invariant Violation: Failed to write to a request stream: stream does not exist when dd-trace tries to call GET http://127.0.0.1:8126/dogstatsd/v2/proxy.

Expected behavior

It shouldn't fail and it should passthrough properly.

@marouanekadiri marouanekadiri added bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node labels Nov 28, 2024
@marouanekadiri marouanekadiri changed the title Failed to write to a request stream: stream does not exist with dd-trace Failed to write to a request stream: stream does not exist with dd-trace Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs:triage Issues that have not been investigated yet. scope:node Related to MSW running in Node
Projects
None yet
Development

No branches or pull requests

1 participant