-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Clicking back button after navigating with next/link causes page to download #50686
Comments
Here's a quick link to the problematic code: https://github.com/timrae/nextjs-app-dir-reproduction/blob/main/app/AppBar.tsx |
@timrae For some reason, in your app, navigating between tabs, reloads the entire page: Screen.Recording.2023-06-02.at.16.00.21.movAs you can see at the end of the video, it is only when I disable the cache, that the page downloads. Obviously, a common user, with dev tools closed, has enabled cache so that happens to them. The question is, why is your app not doing SPA navigation, rather it unloads, and I think that makes the browser save the Hopefully this is not a false lead into the issue 🤞 and can actually help us fix it. |
Yes I noticed that it's not doing the SPA navigation as well. It works
correctly in dev though, so I'm not really sure how to proceed with this...
Please let me know if you have any suggestions.
…On Sat, 3 Jun 2023, 2:02 am Joseph, ***@***.***> wrote:
@timrae <https://github.com/timrae> For some reason, in your app,
navigating between tabs, reloads the entire page:
https://github.com/vercel/next.js/assets/21013447/97447baa-8b4c-421e-a760-619f28543461
As you can see at the end of the video, it is only when I disable the
cache, that the page downloads. Obviously, a common user, with dev tools
closed, has enabled cache so that happens to them.
The question is, why is your app not doing SPA navigation, rather it
unloads, and I think that makes the browser save the .rsc format as the
"the page", so that when you go back to it, it downloads the file.
Hopefully this is not a false lead into the issue 🤞
—
Reply to this email directly, view it on GitHub
<#50686 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAVQBYSI7TUJKEZ275QKFYLXJHXBFANCNFSM6AAAAAAYYGOXOU>
.
You are receiving this because you were mentioned.Message ID: <vercel/next
.***@***.***>
|
Could this be related? #49140 somehow the CDN is not serving the rsc file but the HTML one, and that breaks? |
Thanks for your comments, I don't have enough understanding of next.js to say either way, but I tried deploying to Vercel instead of Netlify and it's working there so I'll close this issue for now :) |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP Fri Jan 27 02:56:13 UTC 2023 Binaries: Node: 19.8.1 npm: 9.5.1 Yarn: N/A pnpm: N/A Relevant packages: next: 13.4.5-canary.3 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 4.9.5
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue or a replay of the bug
https://github.com/timrae/nextjs-app-dir-reproduction
To Reproduce
Describe the Bug
When running the reproduction case in production, the browser tries to download a file called 'page1' when you click the browser back button instead of going back to the page called page1. This doesn't happen in dev.
I'm using
next/link
with the Mui Tabs component, I'm not sure if this is relevant or not.I'm also using a hidden nested route so that I can use a client-side root template.
Also not sure if this is related to #45595 or not.
Expected Behavior
Browser goes back to the previous page without trying to download anything
Which browser are you using? (if relevant)
Chrome 113.0.5672.127
How are you deploying your application? (if relevant)
Netlify
The text was updated successfully, but these errors were encountered: