Client-side timing out in Next 15
Unanswered
Serengeti posted this in #help-forum
SerengetiOP
Hi all,
Since upgrading to Next 15 and React 19, our client-side has started progressively timing out on production.
Here's the flow:
* Server logs show that the server-side components are all rendered after ~1s
* Client logs sometimes appear >5s after server-side components have rendered, sometimes they never show up (and client-side never renders).
* This affects the entire site, so even one of our pages that only really calls NextAuth still slows down.
So when someone visits the page, the base page loads, but then the loading bar remains forever (and some items in our suspense's never load). We've verified that the Rails backend we use is returning respones < 1s, so it seems it is somewhere on the NextJS side.
We're using traefik as a load balancer. When we reboot the load balancer, the client-side renders pretty instantly for a few minutes, then it progressively gets slower and slower again until the client-side stops rendering.
When we use NextJS 14 and React 18, this doesn't happen.
We've added 'force-cache' to all of our GET fetches and route-handlers. We've also added staleTimes: 30 to next.config.js to replicate Next 14's caching behaviour. The only route handlers we can't figure out how to cache are those in NextAuth/AuthJS.
Any tips on how to fix this, or debug this further would be very appreciated. You can see the effect noticeably on the homepage suspense (on desktop) at the top of https://himalayas.app
Cheers
Since upgrading to Next 15 and React 19, our client-side has started progressively timing out on production.
Here's the flow:
* Server logs show that the server-side components are all rendered after ~1s
* Client logs sometimes appear >5s after server-side components have rendered, sometimes they never show up (and client-side never renders).
* This affects the entire site, so even one of our pages that only really calls NextAuth still slows down.
So when someone visits the page, the base page loads, but then the loading bar remains forever (and some items in our suspense's never load). We've verified that the Rails backend we use is returning respones < 1s, so it seems it is somewhere on the NextJS side.
We're using traefik as a load balancer. When we reboot the load balancer, the client-side renders pretty instantly for a few minutes, then it progressively gets slower and slower again until the client-side stops rendering.
When we use NextJS 14 and React 18, this doesn't happen.
We've added 'force-cache' to all of our GET fetches and route-handlers. We've also added staleTimes: 30 to next.config.js to replicate Next 14's caching behaviour. The only route handlers we can't figure out how to cache are those in NextAuth/AuthJS.
Any tips on how to fix this, or debug this further would be very appreciated. You can see the effect noticeably on the homepage suspense (on desktop) at the top of https://himalayas.app
Cheers