Back button for rewritten page broken in last version
See original GitHub issueWhat version of Next.js are you using?
10.2.3
What version of Node.js are you using?
14
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
none
Describe the Bug
Pressing the back-button to a rewritten page causes this bug for us in the latest version:

Seems like shouldResolveHref
, which was added in https://github.com/vercel/next.js/pull/25112 is now false
and the router is not able to resolve the href
anymore.
Expected Behavior
Back button to work.
To Reproduce
Have a page that is served through a rewrite, go to another page through a next/link transition (only reproducible on the second transition when the page has not been built yet and you’re testing it locally), go back to the previous page with the browser back button will throw this error.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Use standard redirects - don't break the back button! - W3C
Why? because it could break the "back" button. Imagine that the user presses the "back" button, the refresh would work again, and the...
Read more >FIX: Back Button Not Working in Web Browser?
If clicking or tapping the Back button doesn't do anything or causes the same page to reload, clearing it might help fix things....
Read more >javascript - Getting Backbutton to work in single page website ...
I did this after noticing that the browser listed the previous pages according to the title element in the HTML code. Unfortunately, this...
Read more >4 Design Patterns That Violate “Back” Button UX Expectations
The short version: users expect the “Back” button to take them back to what they perceived to be their previous page.
Read more >Solved: One ui 4.1 update on s21 ultra causes home button
i have the same problem -- HOME not working at all and BACK working sporadically Samsung chat support couldn't help me. taking it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ijjk I just tested this with my integration test and it still seems broken. (https://github.com/vercel/next.js/pull/25666#issuecomment-852393471) will see if I can fix it.
This is happening to me and we don’t use
getServerSideProps
. We do have dynamic routes and use params in the rewrite, but only one.