router icon indicating copy to clipboard operation
router copied to clipboard

[Solid, React?] If `beforeLoad` is a sync function, context is not merged

Open elite174 opened this issue 1 month ago • 1 comments

Which project does this relate to?

Router

Describe the bug

The thing is that beforeLoad function MUST return promise for having correct context for child components. If it's synchronous, then child function may not see the context, so here's either typescript bug (which allows to pass sync function to beforeLoad) or context merge bug.

Your Example Website or App

Steps to Reproduce the Bug or Issue

just make beforeLoad synchronous and try to read the context from child's loader function

Expected behavior

Context should be merged correctly

Screenshots or Videos

No response

Platform

"@tanstack/solid-router": "1.139.10", "@tanstack/solid-start": "1.139.10",

Additional context

No response

elite174 avatar Nov 28 '25 08:11 elite174

please add a reproducer, ideally by forking one of the existing router stackblitz examples

schiller-manuel avatar Nov 28 '25 23:11 schiller-manuel

please add a reproducer, otherwise we'll have to close this

schiller-manuel avatar Dec 17 '25 23:12 schiller-manuel