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

Link to index page with getServerSideProps and basePath results in full page reload #14282

Closed
bernardop opened this issue Jun 17, 2020 · 5 comments
Assignees
Milestone

Comments

@bernardop
Copy link

Bug report

Describe the bug

Using the experimental basePath and linking from any page back to the index page with Link results in a full page reload if the index page uses getServerSideProps. Looking at the network tab in Chrome I see a request to http://localhost:3000/base/_next/data/development.json that 404s. In the production build, the request that 404s looks like this http://localhost:3000/base/_next/data/xpCmLw_g1hPw_3b847mWF.json. I believe there's a / missing before .json.

To Reproduce

  1. Clone this repo https://github.com/bernardop/next-basepath-repro
  2. Install dependencies and yarn dev
  3. Go to http://localhost:3000/base
  4. Click on "a" or "b"
  5. Click on "Back" link
  6. Index page does a full load and the network tab shows 404 to .json

Expected behavior

Index page should not fully reload.

System information

  • OS: macOS
  • All browsers
  • Version of Next.js: 9.4.5-canary.8
  • Version of Node.js: 14.4.0

Additional context

I believe this was introduced in 9.4.5-canary.8 and I suspect #13876 is the culprit. 9.4.5-canary.7 does not have this error.

@ijjk
Copy link
Member

ijjk commented Jun 22, 2020

Hi, this should have been resolved in v9.4.5-canary.14 of Next.js specifically this PR #14376

@timneutkens timneutkens added this to the iteration 3 milestone Jun 22, 2020
@ijjk
Copy link
Member

ijjk commented Jun 22, 2020

Closing as this is resolved on latest canary, please reply with additional details if you are still encountering problems after upgrading

@ijjk ijjk closed this as completed Jun 22, 2020
@bernardop
Copy link
Author

Thanks @ijjk, just confirmed it works perfectly now. Also great to see basePath out of "experimental"!

@alecrae
Copy link

alecrae commented Jul 24, 2020

Also confirming this issue seems to be fixed in latest canary 👍 looking forward to 9.4.5!

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants