Skip to content

DefaultCatchBoundary in examples has incorrect match check #7536

@xt0rted

Description

@xt0rted

Which project does this relate to?

Router

Describe the bug

In the examples the DefaultCatchBoundary component does a check of state.id === rootRouteId. In my testing state.id will be __root__/ while rootRouteId will be __root__. I think the correct check should be state.routeId === rootRouteId but maybe I'm wrong.

Complete minimal reproducer

https://tanstack.com/start/latest/docs/framework/react/examples/start-basic-auth?path=examples%2Freact%2Fstart-basic-auth%2Fsrc%2Fcomponents%2FDefaultCatchBoundary.tsx

Steps to Reproduce the Bug

  1. Throw an error inside __root.tsx
  2. Check the value of state.id, it won't match the value of rootRouteId

Expected behavior

The two values should match, which only seems to happen if you use state.routeId instead of state.id.

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.170.11
  • OS: Windows
  • Browser: Chrome
  • Browser Version: 148.0.7778.218
  • Bundler: vite
  • Bundler Version: 8.0.14

Additional context

I copied the code from the example and while throwing errors from various spots to try and see both the Home and Go Back buttons found that the only way I could make this happen was to change the match comparison.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions