Skip to content

Context is missing from parent loader when child's validateSearch fails #4696

@Dakkers

Description

@Dakkers

Which project does this relate to?

Router

Describe the bug

When a parent route (in my case, the root route) has a beforeLoad parameter, the parent route's loader's context is missing expected attributes when a child route's validateSearch fails.

StackBlitz project

StackBlitz container

Your Example Website or App

https://vitejsvitepmq9xxrp-by02--5173--96435430.local-credentialless.webcontainer.io/

Steps to Reproduce the Bug or Issue

  1. Go to the example site
  2. Go to the dashboard link
  3. Ensure you can see the navbar (this is working)
  4. Remove the query parameters from the URL and press enter (to navigate directly to /dashboard with no query params)
  5. You will not see the Navbar anymore 🐛

Expected behavior

I expected the parent route's loader to have the values of the context that were returned by the same route's beforeLoad but the attributes are missing.

Screenshots or Videos

Screen.Recording.2025-07-18.at.10.00.33.mov

Platform

  • Router / Start Version: 1.128.3
  • OS: MacOS
  • Browser: Chrome
  • Browser Version: 138.0.7204.157 (Official Build) (arm64)
  • Bundler: Vite
  • Bundler Version: 7.0.5

Additional context

Related issues, PRs, discussions:

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