Stop Doing This in Next.js: 10 Common Mistakes (and What To Do Instead)
December 12, 2025
You know that feeling when a Next.js app is technically working… but somehow it’s still slow, your caching is unpredictable, and every “small change” turns into a multi-file ritual?That usually isn’t because Next.js is complicated.It’s because of a handful of habits people bring from older React/SPA patterns, habits that fight the way modern Next.js (App Router + Server Components) is designed to work.Here are 10 mistakes I see over and over, and what to do instead.
1) Putting “use client” Everywhere
What it looks like
You need a click handler on one button… so you mark the entire page as a Client Component.
Why it hurts
You ship more JavaScript than you need.
You lose server-only benefits (better streaming, smaller bundles, safer data access).
You start dragging server-only code into the browser by accident.
Do this instead
Default to Server Components.
Create small “islands” of interactivity as Client Components.
5) Using Middleware for Proxying (or Backend Logic)
What it looks like
Doing heavy auth checks, DB calls, or trying to proxy requests inside middleware.
Why it hurts
Middleware is designed to be fast and lightweight.
Heavy work there becomes global latency.
Do this instead
Use a proxy route (Route Handler) when you need to forward requests securely, add headers, hide secrets, or normalize responses. Keep middleware for truly tiny edge concerns (like simple redirects), not as a mini-backend.If all you need is simple pass-through routing (no auth, no secrets, no response shaping), prefer a platform-level proxy or rewrites instead of pushing logic into middleware.
// app/api/proxy/products/route.ts
import { NextResponse } from "next/server";
export async function GET(req: Request) {
const url = new URL(req.url);
const search = url.searchParams.toString();
// Keep secrets on the server
const upstream = `https://example.com/api/products${search ? `?${search}` : ""}`;
const res = await fetch(upstream, {
headers: {
Authorization: `Bearer ${process.env.SECRET_API_KEY}`,
},
});
const data = await res.json();
return NextResponse.json(data, { status: res.status });
}
6) Rebuilding Forms Like It’s 2019
What it looks like
Client state for every input, manual loading flags, custom fetch calls, and duplicated validation.
Why it hurts
You’re writing a lot of code to replicate what the platform already does.
Do this instead
Use HTML forms + Server Actions when it fits.
// app/contact/actions.ts
"use server";
export async function submitContact(formData: FormData) {
const email = String(formData.get("email") || "");
const message = String(formData.get("message") || "");
if (!email.includes("@") || message.length < 10) {
throw new Error("Please provide a valid email and a longer message.");
}
// Save to DB / send email (server-side)
}
If you take nothing else away, take this:Render on the server by default. Ship client JavaScript only where it earns its keep.That single mindset shift prevents bloated bundles, reduces data-fetching hacks, makes caching easier to reason about, and keeps secrets where they belong.If you want, tell me what you’re building (blog, SaaS, ecommerce, portfolio) and where it feels slow or confusing. I can recommend a caching + component boundary strategy that fits your app instead of generic advice.
Enjoyed this blog?
Seriously, thank you for spending your time here. If you made it to the end, you’re the kind of person who cares about craft, not just quick fixes.If you’d like to support my work, pick one (no pressure). It genuinely helps me keep writing and improving these blogs.