Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__TSR_index is NaN, resulting in invalid history notifications (subscriber) #3907

Open
wolkyura opened this issue Apr 1, 2025 · 1 comment

Comments

@wolkyura
Copy link

wolkyura commented Apr 1, 2025

Which project does this relate to?

Router

Describe the bug

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).

Your Example Website or App

https://stackblitz.com/edit/github-gn1q23iq?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

  1. Navigate to About page
  2. Navigate back using browser back button

Expected behavior

I'd expect BACK action type being sent when using browser back button

Screenshots or Videos

Image

Platform

  • macOS
  • Chrome
  • Version: 134.0.6998.166

Additional context

No response

@schiller-manuel
Copy link
Contributor

cc @ferretwithaberet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants