Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Optional params in file path breaking route #196

Open
@joshuagraber

Description

@joshuagraber

Describe the Bug

I encountered a bit of a strange bug recently in"@generouted/react-router"

When an optional param is present in a flat route file path (e.g.pages/foo.-[bar].tsx) the route crashes with a"Not found" error.

However, if I nest the optional segment in a directorypages/foo/-[bar].tsx, all is well.

Generouted Version

@generouted/react-router@1.19.3

Your Example Website or App or Reproduction

https://codesandbox.io/p/github/joshuagraber/generouted-optional-params-bug/main

Steps to Reproduce the Bug or Issue

  1. Run app
  2. Click the links in the index route
  3. Observe the/foo route (flat) breaking, and the/bar route (nested) working as expected.

Expected Behavior

I would expect that flat routes with optional route params defined with valid generouted syntax would render the default export.

Screenshots or Videos

Screen.Recording.2025-03-11.at.2.22.37.PM.mov

Platform

  • OS: macOS
  • Browser: Chrome, Firefox
  • Browser version: FF developer edition 137.0b4, Chrome 134.0.6998.88

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp