Skip to content

[Bug]: RR7 - With basename configured, .data requests against root index not correctly routedΒ #12295

@mpqmpqm

Description

@mpqmpqm

What version of React Router are you using?

7

Steps to Reproduce

Minimal repro

  1. Configure vite.config.base and vite.config.reactRouter.basename.
  2. Add a Link component to the root index, or an action against the root index.
  3. Observe that .data requests against root index are routed to localhost:5173/${basename}.data, rather than e.g. localhost:5173/${basename}/_root.data.
  4. Observe that .data requests against root index 404.

Expected Behavior

.data requests against root index should resolve accounting for configured basename.

Actual Behavior

.data requests against root index 404. .data requests against nested routes resolve as expected.

In minimal repro above, try clicking links to Home and submitting action on that route. Then try the same at About. Observe that About works while Home (root index) doesn't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions