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

Cannot clone Response with null body #110

Closed
payellodevsupport opened this issue Dec 5, 2021 · 3 comments
Closed

Cannot clone Response with null body #110

payellodevsupport opened this issue Dec 5, 2021 · 3 comments
Labels
bug Something isn't working dependency Issue in dependency fixed-in-next Fixed in next release

Comments

@payellodevsupport
Copy link
Contributor

We receive TypeError: Cannot read properties of undefined (reading 'stream') when trying to clone a response with null body.

let cloned = new Response(null, { status: 201 }).clone()
@mrbbot
Copy link
Contributor

mrbbot commented Dec 5, 2021

Hey! 👋 This looks like an error in undici, the package Miniflare uses to provide fetch, Response, FormData, etc. I'd suggest you open an issue there. 🙂

import { Response } from "undici";
new Response(null, { status: 201 }).clone();
Uncaught TypeError: Cannot read properties of undefined (reading 'stream')
    at cloneBody (/.../node_modules/undici/lib/fetch/body.js:251:29)
    at cloneResponse (/.../node_modules/undici/lib/fetch/response.js:331:24)
    at Response.clone (/.../node_modules/undici/lib/fetch/response.js:284:28)

@mrbbot mrbbot added bug Something isn't working dependency Issue in dependency labels Dec 5, 2021
@payellodevsupport
Copy link
Contributor Author

Issue opened at undici - nodejs/undici#1122

mrbbot added a commit that referenced this issue Dec 7, 2021
@mrbbot mrbbot added the fixed-in-next Fixed in next release label Dec 7, 2021
@mrbbot
Copy link
Contributor

mrbbot commented Dec 8, 2021

Hey! 👋 miniflare@2.0.0-rc.3 has just been released, including the fix for this. You can find the changelog here.

@mrbbot mrbbot closed this as completed Dec 8, 2021
mrbbot added a commit that referenced this issue Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependency Issue in dependency fixed-in-next Fixed in next release
Projects
None yet
Development

No branches or pull requests

2 participants