Skip to content

nextjs app dir basePath route manifest bug #17837

@seoyeon9888

Description

@seoyeon9888

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.2.0

Framework Version

Next 14.2.23

Link to Sentry event

No response

Reproduction Example/SDK Setup

next.config.js

const nextConfig = { // other options basePath: '/shop' }

instrumentation-client.ts

import * as Sentry from "@sentry/nextjs"; Sentry.init({ dsn: SENTRY_DSN integrations: [], // other options })

sentry app dir path

  • use next-intl
  • use basePath /shop
./[locale] ./[locale]/[...others] ./[locale]/product/[id] 

Steps to Reproduce

  1. request /shop/ko/product/23kjkfdf url page
  2. sentry send pageload transaction with :locale/:others*

Expected Result

sentry send pageload transaction with shop/:locale/product/:id or :locale/product/:id

Actual Result

sentry send pageload transaction with :locale/:others*

Additional Context

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.

I use next.js app with basePath config option activated with `/shop``

However, when using Sentry, transactions are always parameterized as :locale/:others*.
Because of this, I cannot group transactions correctly (e.g. /shop/ko/product/s192389 should map to :locale/product/:id, or shop/:locale/product/:id but it ends up as /:locale/:others*).

It seems that createRouteManifest generates regexes without considering basePath.

Metadata

Metadata

Assignees

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions