What common performance issues have you faced in Next.js apps? #94103
Replies: 4 comments
-
|
The repeat offenders I see in real Next apps are usually less about one magic setting and more about accidentally moving work to the wrong side of the server/client boundary. The biggest ones:
Putting
This is easy to miss: const user = await getUser()
const posts = await getPosts(user.id)
const stats = await getStats(user.id)If
Calling
A lot of pages ship a loading state, hydrate, then fetch data in
Analytics, chat widgets, tag managers, A/B tools, and session replay can dominate main-thread time. Use
Middleware runs more often than people expect, including for navigations and prefetches depending on matchers. Keep it cheap, and exclude static/internal paths explicitly. Doing database work there is usually a red flag.
Unoptimized hero images, missing For debugging, I would not start with guesses. I usually check, in this order:
The pattern is usually visible once you separate: server time, network waterfall, client JS size, and browser main-thread work. |
Beta Was this translation helpful? Give feedback.
-
|
`Some of the most common performance issues I've faced in Next.js applications are:
In recent projects, moving more logic to Server Components, optimizing images, code splitting, and implementing caching strategies significantly improved performance and Core Web Vitals scores.` |
Beta Was this translation helpful? Give feedback.
-
|
Great question! Here are some common performance issues I've encountered in Next.js apps: 1. Excessive Client Components (
|
Beta Was this translation helpful? Give feedback.
-
|
Great thread! One angle I have not seen mentioned yet is what the data actually shows when you audit real Next.js sites in production. I have been running automated audits on Next.js sites for a side project. Across the ones I have checked, the most common measurable issues are: Missing or incorrect sizes on next/image — This is the #1 LCP culprit. People use next/image but omit the sizes attribute, causing the browser to download desktop-sized images on mobile. Adding sizes can improve LCP by 15-20 points. Render-blocking third-party scripts labeled beforeInteractive — Even with next/script, analytics and chatbots are often set to beforeInteractive when they should be afterInteractive or lazyOnload. Fixing this can shave 300-800ms off LCP. Server Components returning waterfall fetches — The RSC payload can hide a sequential chain like fetch user then fetch posts then fetch comments. Using Promise.all for independent fetches even in server components makes a big difference. Unused JavaScript in client bundles — Full icon libraries imported when only 3-4 icons are used. A quick check with bundle-analyzer reveals 50-200KB of unnecessary client JS. For your research, I would suggest adding actual Lighthouse/CWV scores from a sample of production Next.js sites. Knowing how many sites have each problem tells you where to focus. Hope this helps! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
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:
Would really appreciate hearing real problems you’ve faced and, if possible, how you fixed them. Thanks! 🙌
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions