Skip to content

Is it normal for the routeId to change when using relative() in a routes config? #14125

@wonu

Description

@wonu

Reproduction

https://stackblitz.com/edit/github-k4qxzj9k-avwnbkjs

https://stackblitz.com/edit/github-k4qxzj9k

System:
  OS: Linux 5.0 undefined
  CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Memory: 0 Bytes / 0 Bytes
  Shell: 1.0 - /bin/jsh
Binaries:
  Node: 20.19.1 - /usr/local/bin/node
  Yarn: 1.22.19 - /usr/local/bin/yarn
  npm: 10.8.2 - /usr/local/bin/npm
  pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
  @react-router/dev: ^7.7.1 => 7.7.1 
  @react-router/node: ^7.7.1 => 7.7.1 
  @react-router/serve: ^7.7.1 => 7.7.1 
  react-router: ^7.7.1 => 7.7.1 
  vite: ^6.3.3 => 6.3.5

Used Package Manager

npm

Expected Behavior

Route ids should still reflect a relative file path when the relative helper is used

Actual Behavior

They reflect the absolute path to the route files:

// useMatches().map((m) => m.id)
[
  "root",
  "/home/projects/github-k4qxzj9k-avwnbkjs/app/routes/home"
]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions