-
Notifications
You must be signed in to change notification settings - Fork 26k
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
Problem of calling a page twice when navigating a page using nextLink #49970
Comments
@smo043 @jakepeyser |
@holicreact - Amazing thank you |
Reference #49844 |
Are you calling pre fetch a defect? I don't see the problem here after cloning your code. Can you provide more details of the duplication? I'd close this issue as invalid. I see nothing wrong here. |
@johnson-jesse I am used opton prefetch = {false} |
Hi, I'm having the same issue on my localhost . For some reason it call twice getDomainStories().
See My log:
Im runnign latest version "next": "^13.4.3" "react": "^18.2.0", Best |
@ivanhueso Tell me under what conditions you're called twice |
Hi,
This double call happens intermittent. Hope this give you enough context. |
@ivanhueso It's a little different from my case, but I think a double call occurs when the dynamic path is charged. |
We are also seeing "double" requests upon clicking on |
Yes, I'm using the header() function in the root layout and some pages too. However this wasn't happening before in older version. I see this happen only in my localhost |
Same issue for me too. |
@levipadre @ivanhueso @Enngage |
@levipadre I hope the next team sees this article |
Closes by #51292 |
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: darwin Arch: arm64 Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101 Binaries: Node: 18.13.0 npm: 8.19.3 Yarn: N/A pnpm: 8.2.0 Relevant packages: next: 13.4.2-canary.4 eslint-config-next: 13.1.0 react: 18.2.0 react-dom: 18.2.0 typescript: 4.9.4
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Internationalization (i18n), Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue
https://github.com/holicreact/app-directory-v2.git
To Reproduce
https://app-directory-v2.vercel.app/context
From the client context page, open the Developer Tools Network tab
Click on the sub-links
For example, when you have a [categorySlug][subCategorySlug] path, if you browse the categorySlug page, you request the page only once, but when you browse the subCategorySlug path, you request the page twice
Describe the Bug
What is the improvement or update you wish to see?
Problem of calling a page twice when navigating a page using nextLink
Is there any context that might help us understand?
If you apply the prefetch={false} option to nextLink, the page is called twice when navigating the page of a sub-dynamic segment of the dynamic segment path.
I am sending additional unnecessary API requests because I make API requests inside the page.
For example, when you have a [categorySlug][subCategorySlug] path, if you browse the categorySlug page, you request the page only once, but when you browse the subCategorySlug path, you request the page twice
If this is a bug, please fix it If it's not a bug, please let me know how to prevent page duplicate calls Thank you.
Expected Behavior
Send a lot of API requests and send meaningless requests to the server
It's hard to check the log
Waste server resources
It interferes with collecting API request data.
Which browser are you using? (if relevant)
113.0.5672.126 (arm64)
How are you deploying your application? (if relevant)
vercel
The text was updated successfully, but these errors were encountered: