Skip to content

polyfilled fetch behaves differently from node's builtin fetch and browser's fetch #7519

Open
@marko154

Description

@marko154

What version of Remix are you using?

1.18.1

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

When using a Request object to call fetch, a DELETE request with body is sent without the body. ky builds a request to call fetch, which is how I found this. Looks like the problem might be in the remix-run/web-std-io library, because this works using web-std/io.

const options = {
    method: "DELETE",
    body: "some json here"
}

// this works
fetch(url, options)

const request = new Request(url, options)
// this does not send the body
fetch(request)

Here is a codesandbox reproduction.

Expected Behavior

Fetch should behave the same way using

fetch(url, options)
const request = new Request(url, options)
fetch(request)

Actual Behavior

When calling fetch with a Request object, a DELETE request with a body is sent without the body.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions