Skip to content

Next.js App Router + trailingSlash: true seems to cause pageload transactions to be named /:slug* for unrelated routes #19241

@ReneGreen27

Description

@ReneGreen27

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

9.44.0

Framework Version

Next.js 13+/15

Link to Sentry event

No response

Reproduction Example/SDK Setup

Repro linked contained within internal ticket #171187

Steps to Reproduce

When using the Next.js App Router together with a catch-all route and trailingSlash: true, Sentry pageload transactions are incorrectly named /:slug* for nearly all routes, even when those routes were not reached via the catch-all page.

Disabling trailingSlash restores correct transaction naming. This appears to be an unintended interaction between Sentry’s Next.js route naming logic and Next.js routing when trailing slashes are enabled.

Environment

Framework: Next.js App Router

Next.js version: recent (reproduced on modern versions; see internal ticket)

Sentry SDK: @sentry/nextjs

Runtime: Browser (pageload transactions)

Deployment mode: production (NEXT_PUBLIC_SENTRY_ENV=production)

Expected Result

Pageload transactions should be named after the actual route being visited
A catch-all route exists elsewhere in the app
trailingSlash: true is enabled

Actual Result

With trailingSlash: true enabled:
Most pageload transactions are named: /:slug*

This occurs even when navigating directly to routes that do not use the catch-all

As a result, nearly all pageload transactions collapse into a single route in Sentry, losing per-page observability

Disabling trailingSlash immediately restores correct transaction names.

Additional Context

Is this a known limitation of the Next.js App Router integration, or is this a bug in how Sentry derives route names when trailingSlash is enabled?

If this is a bug, is there a recommended workaround until a fix is available?

Priority

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

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions