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

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

Open
3 tasks done
punkpeye opened this issue Sep 13, 2024 · 1 comment
Open
3 tasks done
Labels
Package: node Issues related to the Sentry Node SDK

Comments

@punkpeye
Copy link

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

Fastify@4.28.1

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>
@github-actions github-actions bot added the Package: node Issues related to the Sentry Node SDK label Sep 13, 2024
@mydea
Copy link
Member

mydea commented Sep 16, 2024

Thank you for raising this! We probably need to widen the return type here - I'll put this in our backlog to work on, PRs for this are also welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: node Issues related to the Sentry Node SDK
Projects
Status: No status
Development

No branches or pull requests

2 participants