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
{{ message }}
Repository navigation
__TSR_index is NaN, resulting in invalid history notifications (subscriber) #3907
I tried subscribing to router history changes to track back/forward navigation, but it's not working for me. When using the browser’s back/forward buttons, I get this action - { type: 'GO', index: NaN }.
I looked into history/src/index.ts and found that the history index is stored in __TSR_index, and in my case, it's NaN (see screenshot).
Thanks for the report. I can still reproduce this on current main.
createBrowserHistory treats an existing key/__TSR_key as initialized state even when __TSR_index is missing. The next navigation then derives an index from undefined, which becomes NaN, and the following popstate is reported as GO.
This needs a small normalization step for partial existing history state, plus a browser-history regression test.
Activity
schiller-manuel commentedon Apr 1, 2025
cc @ferretwithaberet
LadyBluenotes commentedon Jul 12, 2026
Thanks for the report. I can still reproduce this on current main.
createBrowserHistorytreats an existingkey/__TSR_key as initialized state even when __TSR_index is missing. The next navigation then derives an index from undefined, which becomesNaN, and the following popstate is reported asGO.This needs a small normalization step for partial existing history state, plus a browser-history regression test.