Title: Client route parameterization names everything /:lng/:notFound* when the locale param is [lng] and the default locale has no URL prefix · Issue #23488 · getsentry/sentry-javascript · GitHub
Open Graph Title: Client route parameterization names everything /:lng/:notFound* when the locale param is [lng] and the default locale has no URL prefix · Issue #23488 · getsentry/sentry-javascript
X Title: Client route parameterization names everything /:lng/:notFound* when the locale param is [lng] and the default locale has no URL prefix · Issue #23488 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/23488
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Client route parameterization names everything /:lng/:notFound* when the locale param is [lng] and the default locale has no URL prefix","articleBody":"# Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n# How do you use Sentry?\n\nSelf-hosted / on-premise\n\n# Which SDK are you using?\n\n@sentry/nextjs\n\n# SDK Version\n\n10.70.0\n\n# Framework Version\n\nNext.js 16.2.6 (App Router)\n\n# Link to Sentry event\n\n(self-hosted)\n\n# Steps to Reproduce\n\nOur app dir uses `[lng]` as the locale param (i18next convention), with a catch-all for hard 404s:\n\n```\napp/\n [lng]/\n page.tsx\n guides/[category]/[...rest]/page.tsx\n [...notFound]/page.tsx\n```\n\nThe default locale is served without a prefix: `/guides/renting/foo` for en, `/fr/guides/renting/foo` for fr.\n\nBuild with route manifest injection enabled (the default) and load any default-locale page with 2+ path segments.\n\n# Expected Result\n\n`/guides/renting/foo` gets named `/:lng/guides/:category/:rest*`, same as the prefixed locales.\n\n# Actual Result\n\nIt gets named `/:lng/:notFound*`. Same for basically every unprefixed URL with 2+ segments, so most of our traffic (default locale) reports transactions and error culprits pointing at the 404 catch-all.\n\nCause: `findMatchingRoutes` has a retry that prepends `SENTRY_OPTIONAL_PREFIX` for exactly this unprefixed-default-locale case, but it only runs for routes with `hasOptionalPrefix`, and `createRouteManifest.ts` only sets that flag when the first param is literally `locale`, `lang` or `language`:\n\n```ts\n// packages/nextjs/src/config/manifest/createRouteManifest.ts\nfunction hasOptionalPrefix(paramNames: string[]): boolean {\n const firstParam = paramNames[0];\n ...\n return firstParam === 'locale' || firstParam === 'lang' || firstParam === 'language';\n}\n```\n\n`lng` isn't in the list, even though it's i18next's own option name and the folder name used in the next-i18next examples. So for `[lng]` projects the regexes never match unprefixed paths and the catch-all wins. Only workaround right now is `routeManifestInjection: false`, which drops parameterization entirely.\n\n# Proposed fix\n\nAdd `'lng'` to the list, and/or make it configurable. Already raised in the #17927 description:\n\n> Maybe we should make certain aspects of this configurable, like the `['locale', 'lang', 'language']` collection\n\ne.g.:\n\n```ts\nrouteManifestInjection: {\n localeParamNames: ['lng']\n}\n```\n\nCan open a PR for either.\n","author":{"url":"https://github.com/otaviosoares","@type":"Person","name":"otaviosoares"},"datePublished":"2026-08-22T06:07:55Z","url":"https://github.com/getsentry/sentry-javascript/issues/23488"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9fa8f0fd-a503-8aa1-62f3-1427bb3e5e30 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 867E:1FE3C2:B4BA4:EEAA8:6B04C803 |
| html-safe-nonce | f96033e9bf443c83ed9f9cba91bf85c345ef42723a197b4052dd756a6e57f97e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjdFOjFGRTNDMjpCNEJBNDpFRUFBODo2QjA0QzgwMyIsInZpc2l0b3JfaWQiOiI3NjIwMjkwNTIzNTA4ODE5OTcxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4de261999562f471f1c9b729d15b327e288b3f9a1f405748e7cd10400c832ac5 |
| hovercard-subject-tag | issue:5220466721 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/23488/issue_layout |
| twitter:image | https://opengraph.githubassets.com/413564aa0b3a7eef0314b58dde80952e2bac09cc31b9cdf42300328600c86ae0/getsentry/sentry-javascript/issues/23488 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/413564aa0b3a7eef0314b58dde80952e2bac09cc31b9cdf42300328600c86ae0/getsentry/sentry-javascript/issues/23488 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | otaviosoares |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85dd75377eb77313206b8fc108bcee6a3a029286d94bf32bf9b4426e4d92e0c4 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0d64fa748a2bab9a5b587a967ac4da1cfa8da6dd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width