Skip to content

replyWithErrorPage TypeScript types break when Fastify is initiated with http2: true #13696

Open
@punkpeye

Description

@punkpeye

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

8.30

Framework Version

[email protected]

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

const app = fastify({
  bodyLimit: 32 * 1_024 * 1_024,
  http2: true,
  trustProxy: true,
});


app.setErrorHandler((error, request, reply) => {
  return replyWithErrorPage(reply, error);
});

Expected Result

No TypeScript error.

Actual Result

Argument of type 'FastifyReply<Http2Server, Http2ServerRequest, Http2ServerResponse, RouteGenericInterface, unknown, FastifySchema, FastifyTypeProviderDefault, unknown>' is not assignable to parameter of type 'FastifyReply<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, RouteGenericInterface, unknown, FastifySchema, FastifyTypeProviderDefault, unknown>'.
  Type 'Http2ServerRequest' is missing the following properties from type 'IncomingMessage': headersDistinct, trailersDistinctts(2345)
(parameter) reply: FastifyReply<Http2Server, Http2ServerRequest, Http2ServerResponse, RouteGenericInterface, unknown, FastifySchema, FastifyTypeProviderDefault, unknown>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions