Skip to content

Next.js App Router with Turbopack: route handler error not capturedΒ #17705

@KirillTregubov

Description

@KirillTregubov

Related: #8105

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

10.12.0

Framework Version

Next 15.5.3

Link to Sentry event

No response

Reproduction Example/SDK Setup

https://github.com/KirillTregubov/nextjs-sentry-demo

This repo was generated by following this quick start followed by this step in the Sentry Next.js docs

Steps to Reproduce

  1. Clone repo
  2. Install dependencies (I used bun i)
  3. Create an .env file and provide SENTRY_AUTH_TOKEN= inside it.
  4. Run the dev script and add the --turbo flag (I used bun dev --turbo)
  5. Send a request to http://localhost:3000/api/sentry-example-api (I navigated using my browser)

Expected Result

Thrown SentryExampleAPIError("This error is raised on the backend called by the example page.") in the route handler is captured.

Actual Result

Error does not show up in the Sentry dashboard.

Additional Context

The error is properly captured when run without Turbopack. Repeat the following steps:
4. Run the dev script (I used bun dev)
5. Send a request to http://localhost:3000/api/sentry-example-api (I navigated using my browser)

You will notice that the error properly shows up in the dashboard.

Tip: React with πŸ‘ to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions