Skip to content

[react-router, solid-router] Route context is missing when navigating away from a route too quickly #6040

@jakst

Description

@jakst

Which project does this relate to?

Router

Describe the bug

When instantly navigating away from a route (like directly inside an effect), the layout above get's undefined as route context, if the route context finishes loading after the navigation.

The example is in solid-router, but the same issue exists with react-router.

Your Example Website or App

https://github.com/jakst/tsr-missing-route-context

Steps to Reproduce the Bug or Issue

  1. Start the dev server and open up the app
  2. Notice the alert being printed about missing route context (which should always exist)

Expected behavior

I expect the route context to always be defined

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.140.0
  • OS: MacOS
  • Browser: Chrome
  • Browser Version: 143
  • Bundler: vite
  • Bundler Version: 7.2.6

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