You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go to /, and the browser will redirect you to /login at the first time
Click "Login", and the browser will set some state and redirect you to the /feed/all page
In the /feed/all page, it shows feedId = (error)
See the router devtools, the context feedId exists in /feed/all but not /feed/all/
Refresh the page, it shows feedId = "all" (expected)
(If you need, you can click the logout button and restart from the step 1 to see or inspect the situation again)
Expected behavior
In the step 3, it should show feedId = "all". In the step 4, the context in the /feed/all/ should be the same as /feed/all
Screenshots or Videos
Platform
OS: macOS
Browser: Chrome
Version: 132.0.2957.140 (Official build) (arm64)
Additional context
I try my best to make the reproduce example minimal. But the trigger condition is indeed complex.
Most interesting, if change the last line of SyncProvider (/src/lib/sync/provider.tsx) from return <AContext.Provider value={db}>{children}</AContext.Provider>; to return children, the issue disappears.
The text was updated successfully, but these errors were encountered:
thanks for the good reproducer.
i noticed that if you convert the loader in src/routes/login/callback.tsx to a beforeLoad, it also works.
So there must be some race condition / timing issue that appears when a redirect is thrown from a loader.
Which project does this relate to?
Router
Describe the bug
I recently encountered an issue where the parent route sets a context value in beforeLoad, but the child route does not inherit it.
I've posted this in #3403 (reply in thread) previously.
Your Example Website or App
https://stackblitz.com/~/github.com/ImSingee/tanstack-router-bug-report-hauecq3w
Steps to Reproduce the Bug or Issue
/
, and the browser will redirect you to/login
at the first time/feed/all
page/feed/all
page, it showsfeedId =
(error)feedId
exists in/feed/all
but not/feed/all/
feedId = "all"
(expected)(If you need, you can click the
logout
button and restart from the step 1 to see or inspect the situation again)Expected behavior
In the step 3, it should show
feedId = "all"
. In the step 4, the context in the/feed/all/
should be the same as/feed/all
Screenshots or Videos
Platform
Additional context
I try my best to make the reproduce example minimal. But the trigger condition is indeed complex.
Most interesting, if change the last line of
SyncProvider
(/src/lib/sync/provider.tsx
) fromreturn <AContext.Provider value={db}>{children}</AContext.Provider>;
toreturn children
, the issue disappears.The text was updated successfully, but these errors were encountered: