Skip to content

withSentry wrapper causes stalled request warning with async request handlers in Next.JS #4007

@maurocolella

Description

@maurocolella

Environment

self-hosted (onpremise deployment)

Version

^6.12.0

Steps to Reproduce

  1. Create a starter Next.JS project with API routes. https://nextjs.org/docs/api-routes/introduction
  2. Install and configure @sentry/nextjs
  3. Create async route handlers. Ie. export default withSentry(async (req, res) => {
  4. Implement any route responder, ie. res.status(200).end()
  5. Test the route. For example, create a button that issues an api call.

Expected Result

The route responds and no error is raised.

Actual Result

API resolved without sending a response for /api/<endpoint>, this may result in stalled requests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions