Next.js Discord

Discord Forum

Long wait time from initial RSC on fast-loading page

Unanswered
Pinea posted this in #help-forum
Open in Discord
I have a page which easily loads within <1s when opening in a new tab, however when using Next/Link it takes >30s to load naturally, or by clicking a Radix UI popover/sheet/dialog which causes the refresh to happen immediately after it's clicked.

I've attached how the browser sees the request - there's he initial RSC, shortly after a Next chunk, then ~10s until I manually opened a popover which triggered the refresh immediately.

What causes this? What can I look into to fix it, and why do popovers/etc make any difference?

4 Replies

Chub mackerel
It’s RSC fetch stalling on client nav. New tab is instant since it’s full HTML. Popover just makes React flush the render. Check slow data calls/logs.
Is there a way to make next/link flush the render too?
Chub mackerel
It’s normal next/link triggers a streaming RSC fetch, so client nav waits for the server component. Full-page loads are instant because HTML is ready. Popovers flush React and force render. To fix, prefetch the page, move slow parts to client components, or check your server data calls.