Open benhonda opened 9 months ago
I don't see this issue happening on the docs, but I do experience this in my app. Currently also looking for a solution...
Same here next 14.0.1
Is there any workaround or smth we can use to avoid this issue? thanks
I can reproduce the bug in our project. Any plans for a fix?
I cannot reproduce it anymore on the docs page. My problem is similar (using Next.js 14 app router):
window.location.hash = '#l=es'
#l=it
router.back()
(the router from next/navigation
)Behavior:
/pokemon/#l=it
, but the intercepted view is still shownrouter.back()
again it goes to '/pokemon/#l=es' and the intercepted view disappearsDesired behavior:
/pokemon/#l=it
and the intercepted view is removed from the domI have similar issue, using next 14.2.3 App Router.
I am on page
https://www.bettingtipsafrica.com/betting-sites/
then i click Countries in right sidebar which take me to hash link
https://www.bettingtipsafrica.com/betting-sites/#other-countries
When i choose some country or click any link in footer or header , for example i click Tanzania
https://www.bettingtipsafrica.com/betting-sites/tanzania/
it take me to page and show correct content, which is good, now when i click back button in browser,
url changed to https://www.bettingtipsafrica.com/betting-sites/#other-countries.
which is also fine. but content did not change
content still showing of page https://www.bettingtipsafrica.com/betting-sites/tanzania/
It should be showing content of
https://www.bettingtipsafrica.com/betting-sites/#other-countries
you can verify content by going to top of page and see main headin
Link to the code that reproduces this issue
https://github.com/benhonda/nextjs-router-bug
To Reproduce
Current vs. Expected behavior
Currently, the URL changes and the page may scroll, but the page content does not change.
I expect the page to navigate back to the previous content (as specified in the URL) and for my scroll position to be at the specified hash.
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
App Router
Additional context
The "Link to the code that reproduces this issue" just leads to an empty template but I have a good excuse - I swear! I came across this issue in my local development, where I needed to set hash links to footnotes for A11y purposes, however since the issue also appears to be present on the nextjs docs site, I decided to just use that as my example for convenience.