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

msw with worker runtime: Your worker created multiple branches of a single stream (for instance, by calling response.clone() or request.clone()) #1757

Open
leonardo-ornelas opened this issue Feb 14, 2024 · 0 comments

Comments

@leonardo-ornelas
Copy link

leonardo-ornelas commented Feb 14, 2024

What is the location of your example repository?

No response

Which package or tool is having this issue?

Oxygen

What version of that package or tool are you using?

2.0.3

What version of Remix are you using?

2.6.0

Steps to Reproduce

When you add msw on new worker runtime:

server.ts
image

Expected Behavior

No console errors in requests and the server should continue to respond normally.

Actual Behavior

Error message on every request:

Your worker created multiple branches of a single stream (for instance, by calling `response.clone()` or `request.clone()`) but did not read the body of both branches. This is wasteful, as it forces the system to buffer the entire stream of data in memory, rather than streaming it through. This may cause your worker to be unexpectedly terminated for going over the memory limit. If you only meant to copy the request or response headers and metadata (e.g. in order to be able to modify them), use the appropriate constructors instead (for instance, `new Response(response.body, response)`, `new Request(request)`, etc)

At some point, if you keep making more and more requests, the server will stop responding. This is a block to use msw on hydrogen project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant