-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
navigation delayed for 60 seconds #55735
Comments
I'm unfortunately unable to reproduce this, but I can see an issue in your reproduction, in the root layout. You are missing This can be related. Please refer to the docs: https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts#root-layout-required |
Thanks for attempting to reproduce it. Note that I believe this is a race condition and the timing has to be very precise. I am not able to reproduce it on every navigation. The html and body being in the locale layout is a suggestion of next-intl which I suppose is important so that locale can be added as an attribute to the html tag. In any case, it is not super relevant to the reproduction, so I have moved html and body in the root layout. I was still able to reproduce the issue. |
I was also able to successfully reproduce it on a second M2 macbook pro, this time using brave as a browser. |
I'm unable to reproduce too 🤔 , using M1 Chrome, Safari and Arc. Btw, I had a smooth experience using next-international, give it a try. |
That is an incorrect suggestion by Could you verify if the issue still happens when correctly following the Next.js docs? |
I have not been able to reproduce it in safari either. So far only edge, chrome, and brave. Arc is a blink browser so I will spend some time to see if I can reproduce that. |
We will consider not following this advice from next-intl. I'll open an issue over on the next-intl repository to discuss that further. I was able to reproduce the issue with the structure recommended from the nextjs docs. I have updated my reproduction repository to reflect this too. |
I can see |
You also say that it cannot be reproduced without |
That comment got taken along with the suggestion to move html and body in the root layout. I updated the reproduction repository with the comment in the correct location. |
I wanted to double check if standalone mode was really necessary. I removed it and I was able to reproduce it! So I've update the repository to reflect that too. |
Can you try with yarn, pnpm or bun, maybe is npm 🙈 |
Nice idea. I could still reproduce it using:
|
Reproduction without using standalone mode, using bun, and using arc. This time I didn't trim out the navigations that worked properly. reproduction-3.mp4 |
To rule out the hosting side of things, here is a reproduction using a vercel hosted version. I deployed this using the standard options. reproduction-4.mp4 |
@balazsorban44 Can you provide more details on this? How would a user add a This is btw. suggested in your official documentation: For the i18n use case, it would be really important that providing the |
I would also like to add to your question - what to do with not-found.tsx and global-error.tsx, which should also be in the app folder, if they also need to be internalized? |
@balazsorban44 have you been able to reproduce this yet? Can I do anything to help here? |
I'm facing exactly same issue from |
facing the same problems right now, all our links do not update route. we dont use i18n. |
Experiencing same delay on my side when a user navigates to another page "next": "14.0.4", |
Link to the code that reproduces this issue
https://github.com/andrew-gropyus/next-hydration-issue
To Reproduce
npm install && npm run build && npm run start
localhost:3000/en/red
in either edge or chromeHere is a video of the issue, note that I triggered navigation after reloading with ctrl+R:
reproduction-1.mp4
Current vs. Expected behavior
When clicking a link that navigates to a different nextjs page, I expect that data is fetched in the background and when fetching is complete hydration of the components will take place.
However, when triggering a navigation within a small time window of the page load, the data fetching completes but hydration is delayed for 60 seconds.
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 22.6.0: Wed Jul 5 22:21:56 PDT 2023; root:xnu-8796.141.3~6/RELEASE_X86_64 Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 1.22.19 pnpm: 7.5.0 Relevant Packages: next: 13.5.3-canary.0 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.3 Next.js Config: output: standalone
Which area(s) are affected? (Select all that apply)
App Router,
Standalone mode (output: "standalone")Additional context
Triggering a navigation during the 60 second pause causes navigation to work as expected
reproduction-2.mp4
Not shown in this reproduction is that if a prefetch link exists, hovering over it will cause the original hydration to take place.
I believe this user also reported the same issue, however they did not provide steps to reproduce it:
#53242 (comment)
The text was updated successfully, but these errors were encountered: