Skip to content

Router optional param not matching starting on 1.139.1 #5952

@leonardo2204

Description

@leonardo2204

Which project does this relate to?

Router

Describe the bug

Optionl parameters in route are broken. For instance, anunciar-test{-$citySlug}.tsx is not matching any route (neither /anunciar-test nor /anunciar-test-xpto)

Your Example Website or App

https://stackblitz.com/edit/github-pwe29hgr?file=src%2Fmain.tsx

Steps to Reproduce the Bug or Issue

Simply check the Bug Route in the navbar. It is matching the root ("/"), and it does not redirect to the correct route ("/anunciar-test") or ("/anunciar-test-xpto")

Expected behavior

Match "/anunciar-test" or "/anunciar-test-xpto".
It used to work on 1.139.0. Broken after.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.139.3
  • OS: [e.g. macOS, Windows, Linux] MacOS
  • Browser: [e.g. Chrome, Safari, Firefox] Chrome
  • Browser Version: [e.g. 91.1] 142.0.7444.60
  • Bundler: [e.g. vite] Vite
  • Bundler Version: [e.g. 7.0.0] 7.2.4

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions