question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Back button for rewritten page broken in last version

See original GitHub issue

What 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:

Screen Shot 2021-05-26 at 10 34 29 AM

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:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
PepijnSenderscommented, Jun 1, 2021

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

1reaction
m-bpcommented, May 27, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found