<Link /> component taking so long to load a client page
Unanswered
Transvaal lion posted this in #help-forum
Transvaal lionOP
Hi guys, i have a link component that is going to a client page. for some reason this takes up to 30 seconds before navigating to that pge. Why is it doing this? How can i debug / fix?
19 Replies
Asian black bear
Does this happen in production?
Transvaal lionOP
Yeah
@Asian black bear
Asian black bear
If this is happening in actual production and not local development you need to analyze your logs and tracing details where the bottleneck is. It's likely you are performing some data fetching that is blocking and taking too long. Either because it's too much data or the data source you're querying is slow etc.
@Asian black bear If this is happening in actual production and not local development you need to analyze your logs and tracing details where the bottleneck is. It's likely you are performing some data fetching that is blocking and taking too long. Either because it's too much data or the data source you're querying is slow etc.
Transvaal lionOP
But the page i am fetcing is a page that is 'use client', you're saying somewhere in a layout file there is something blocking the page from loading?
Asian black bear
Pages are not supposed to be marked with
'use client'
and even if you do, they still get prerendered on the server.Transvaal lionOP
I did <Link prerender={false} /> but still long loading time, will that change anything?
I guess I need help analyzing my logs I dont know how to do that
i am looking at vercel logs page but it doesnt show speed load times
i am looking at vercel logs page but it doesnt show speed load times
Asian black bear
No, because that prop does something entirely different. You need to share the code of the page in question, otherwise it's impossible to vaguely guess what's wrong.
Transvaal lionOP
Also thank you for helping me I really appreciat the kindness ❤️
Asian black bear
Also keep in mind you can try to to run a production build locally to verify whether the same issue is happening with a local production build.
Transvaal lionOP
Okay do you need the code to every layout file prior too? or just the page?
@Asian black bear Also keep in mind you can try to to run a production build locally to verify whether the same issue is happening with a local production build.
Transvaal lionOP
You're saying do this and just run console log in every file? It's the same speed / effectiveness as production? and will it use my local host api or my production api?
Asian black bear
I haven't said anything about any console log-ging. I was refering to you running a
next build
of your project and next start
locally to verify whether the same behavior can be observed locally while running the application against production databases/APIs etc.And in terms of code you need to share all the relevant pieces along the hierarchy of the page in question, such as parent layouts etc. which could possibly perform data fetching etc.
@Asian black bear I haven't said anything about any console log-ging. I was refering to you running a `next build` of your project and `next start` locally to verify whether the same behavior can be observed locally while running the application against production databases/APIs etc.
Transvaal lionOP
Can I send it to you in DM instead of in the server?
Asian black bear
No, I am not providing any help privately and this would also make it impossible for others to help as well.
Transvaal lionOP
Also I did next build and next start and it's blazing fast
Original message was deleted
Transvaal lionOP
What?