-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
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.
Your Example Website or App
https://vitejsvitepmq9xxrp-by02--5173--96435430.local-credentialless.webcontainer.io/
Steps to Reproduce the Bug or Issue
- Go to the example site
- Go to the dashboard link
- Ensure you can see the navbar (this is working)
- Remove the query parameters from the URL and press enter (to navigate directly to
/dashboard
with no query params) - 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:
- Empty context with parent / child
beforeLoad
,loader
andvalidateSearch
#3578 - Sometimes the child route doesn't inherit parent context #3430
- fix: if validate search rewrites search params, issue a server-side redirect #4439
- fix: only re-execute beforeLoad if previous run failed #4433
- beforeLoad of child route is called even when parent’s beforeLoad throws an error #4151
- beforeLoad of children running before beforeLoad of the parent has finished #1737
Metadata
Metadata
Assignees
Labels
No labels