Skip to content

Node.js HTTP2 error #3803

@Lugribossk

Description

@Lugribossk

Describe the bug

When trying to run the server using the Node.js http2 module and createSecureServer(), requests always return this error:

    {
      "message": "POST body sent invalid JSON.",
      "extensions": {
        "code": "BAD_REQUEST",
        "originalError": {
          "name": "TypeError",
          "message": "bodyInit.stream is not a function"
        }
      }
    }

Your Example Website or App

https://codesandbox.io/p/devbox/great-fog-v5xjzq?file=%2Fsrc%2Fmain.ts%3A41%2C1

Steps to Reproduce the Bug or Issue

  1. Create a cert for localhost with https://github.com/FiloSottile/mkcert (mkcert -install, mkcert localhost)
  2. Run the example code.
  3. Make a request to the server, e.g. with Graphiql.

Expected behavior

The request should have worked normally. Or perhaps that there should have been a Typescript error indicating that createSecureServer and yoga are incompatible.

Screenshots or Videos

No response

Platform

  • OS: Windows 11
  • NodeJS: 22.14.0
  • @graphql-yoga/* version(s): 5.12.0

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions