r/reactjs • u/lakshan-hewagama • May 25 '26
Needs Help What common performance issues have you faced in Next.js apps?
Hi everyone, I’m doing my final year research on Next.js performance optimization and would love input from real developers.
From your experience, what common coding or architectural issues make a Next.js app slow?
Examples:
- too many
use clientcomponents - hydration issues
- large JS bundles
- client-side data fetching
- image optimization problems
- third-party scripts
- App Router performance issues
Would really appreciate hearing real problems you’ve faced and, if possible, how you fixed them. Thanks! 🙌
10
Upvotes
9
u/divyacodes May 25 '26
there are many App Router performance issues.
6
u/jokham May 25 '26
In my experience, the biggest performance issues in Next apps usually come from accidentally making too much of the app client-side.
A common one is putting
use clientat the page or layout level, which pushes large parts of the UI into the client bundle. I’ve seen apps get much faster just by moving data fetching and non-interactive UI back into Server Components, then keeping only small interactive pieces as Client Components.Other common problems are large dependencies being imported into client components, unnecessary client-side data fetching with
useEffect, unoptimized images, and third-party scripts loading too early.The fixes are usually: analyze the bundle, reduce
use clientusage, lazy-load heavy components, usenext/image, fetch data on the server where possible, and load non-critical scripts later. For many apps, bundle size and overusing client components are the first things I’d check.2
u/Southern-Piano-7241 May 25 '26
One issue I faced recently was with static builds + localStorage.
I had detail pages depending on client-side IDs stored in localStorage, which caused hydration issues and build problems in Next.js.
Fix was mainly:
* moving browser-only logic into useEffect
* reducing unnecessary use client
* separating SSR and client state more carefully
1
u/vozome May 26 '26
In the ancient times (code written mostly by humans) I would say, use client for initial data fetch. This is not incorrect but it will bite you if that data fetch is heavy.
IMO it’s more uncommon now because agents would naturally try to avoid this. Likewise, poor use of useEffect or other hooks etc. The agents will try not to do that. So, the most common issue is routes, handlers etc. - server side code - doing all sort of things they shouldn’t. This is actually more likely with agentic code, as a by product of using agents to implement features incrementally, and naturally trying to reuse existing code.
4
u/anonyuser415 May 25 '26
What does this mean
1
u/Ok_Challenge2493 Jun 01 '26
Too many `use client` components is the big one, people sprinkle it everywhere and wonder why the bundle is huge. Client-side fetching when you could just fetch on the server kills your LCP instantly. Third party scripts are silent killers, always use `next/script` with the right strategy. And honestly, most people optimize randomly without checking the bundle analyzer first. Fix what the data tells you, not what feels wrong.