Skip to content

@sentry/nextjs: withSentry API helper types incompatible with NextJS #3501

@osdiab

Description

@osdiab

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other: @sentry/nextjs

Version:

6.3.5

Description

nextjs's built in NextApiHandler type for API handlers returns a void | Promise<void> but the withSentry() function from @sentry/nextjs incorrectly only accepts Promise<void>, which means
that using it with non-async API routes makes types fail. withSentry should take in a NextApiHandler, not roll its own overly strict type signature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nextjsIssues related to the Sentry Nextjs SDK

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions