The question I get most this year is some version of: "Why should I learn Next.js when Claude, Cursor or v0 can write it for me?"
It's a fair question. I use AI every day to write code. But here's my honest answer: AI made understanding Next.js more valuable, not less. Let me show you why, with real examples of where AI gets it wrong.
The short answer
AI is great at producing code that looks right. Next.js is full of places where code that looks right is subtly wrong: stale data, a component that ships to the browser when it shouldn't, a Server Action anyone on the internet can call. The skill that matters now isn't typing code. It's knowing whether the code is right.
1. AI writes Next.js by default
Ask an AI app builder for a web app and you'll most likely get React with Next.js conventions. Builders like v0 and Bolt lean on it, likely because Next.js dominates their training data (Appwrite). It's also the most-used server-side web framework among developers, at about 21% in the Stack Overflow 2025 Developer Survey.
That means there's more Next.js code in the world than ever, and much of it was generated by someone who doesn't fully understand it. Someone still has to debug it, extend it, secure it and ship it. That someone is you.
2. AI is weakest exactly where Next.js is hardest: caching
Caching in Next.js changed in every recent major version:
- Next.js 14 cached
fetchrequests by default. - Next.js 15 reversed that:
fetchis no longer cached by default. - Next.js 16 introduced an explicit model with
"use cache"and Cache Components (upgrade guide).
AI models were trained on code from all three eras, so they mix them up. A pattern I see a lot is reading request data inside a cached function:
// โ Reads cookies inside a cached function
async function getDashboard() {
'use cache';
const session = (await cookies()).get('session');
return db.dashboard.find({ userId: session?.value });
}
Cached output is shared, so request-specific data like cookies and headers can't be read inside "use cache". The fix is to read request data outside and pass it in, so it becomes part of the cache key:
// โ
Read request data first, pass it in
async function getDashboard(userId: string) {
'use cache';
return db.dashboard.find({ userId });
}
export default async function Page() {
const session = (await cookies()).get('session');
const data = await getDashboard(session!.value);
// ...
}
One developer migrating to Next.js 16 said most of their bugs ended up being cache-boundary issues (GitHub discussion). Another wrote that the upgrade broke their app in four places without throwing a single error (DEV). You can't review that kind of bug if you don't understand the model.
3. The server/client boundary is a security boundary
In Next.js, where code runs isn't just a performance detail. It decides what's exposed.
Server Actions are public endpoints. AI often writes them like private functions:
// โ Anyone can call this with any id
'use server';
export async function deletePost(id: string) {
await db.post.delete({ where: { id } });
}
Here's the same action with those checks in place:
// โ
Authenticate, authorize, validate
'use server';
export async function deletePost(id: string) {
const user = await getCurrentUser();
if (!user) throw new Error('Not signed in');
const post = await db.post.findUnique({ where: { id } });
if (post?.authorId !== user.id) throw new Error('Not allowed');
await db.post.delete({ where: { id } });
}
Props to Client Components are sent to the browser. Passing a whole database record into a Client Component serializes all of it into the page, including fields you never display:
// โ The whole user row, hashed password included, ends up in the browser
<ProfileCard user={user} />
// โ
Pass only what the component needs
<ProfileCard name={user.name} avatarUrl={user.avatarUrl} />
And the framework itself can have holes. In December 2025, React disclosed CVE-2025-55182, a critical (CVSS 10.0) remote-code-execution vulnerability in React Server Components that affected Next.js 15 and 16. Knowing what runs on your server is how you know what to patch and why.
4. Developers don't trust AI output either
This isn't just me being cautious. In the Stack Overflow 2025 survey, 84% of developers said they use AI tools, but 46% said they don't trust the accuracy of what those tools produce. That's up from 31% the year before. Only 3% highly trust it.
The developers getting the most out of AI aren't the ones who trust it blindly. They're the ones who can tell when it's wrong, quickly.
5. What to learn instead of syntax
You don't need to memorize APIs any more. AI handles that. What you do need is the mental model, so you can direct AI and review its output:
- Server vs Client Components. Server is the default. Add
"use client"only to the interactive leaves, not to whole pages. - The cache model for your version. What's cached, for whom, and how it's invalidated (
revalidateTag,revalidatePath,cacheTag). - Server Actions as endpoints. Auth, authorization and validation in every one.
- Data flow. What gets serialized from server to client, and why it matters.
- Rendering. Static vs dynamic, streaming and Suspense boundaries.
- Deployment. Environment variables, the Node runtime, and what happens in production that doesn't happen locally.
A checklist for reviewing AI-generated Next.js code
Paste this next to your AI tool of choice and go through it before you merge:
- Is
"use client"at the lowest possible level, or did it turn a whole page into a Client Component? - Does any Server Action skip authentication, authorization or input validation?
- Are full database records or secrets passed as props to Client Components?
- Does the caching code match the Next.js version you're on (14, 15 or 16)?
- Is any request data (
cookies(),headers(),searchParams) read inside a cached function? - After a mutation, is the right data revalidated, or will users see a stale screen?
- Are there Suspense boundaries around slow or dynamic parts of the page?
- Is it using
middleware.tswhere Next.js 16 expectsproxy.ts?
Free for developers
Stop your AI from writing broken Next.js
Get my free Next.js Skills file: a SKILL.md you drop into Claude Code, Cursor or any AI coding agent, packed with Next.js 16 best practices and the common mistakes AI keeps repeating. Your AI writes better Next.js from the very next prompt.
Free. You'll also get my newsletter; unsubscribe anytime.
What this means for your career
Entry-level hiring has dropped sharply since 2024, partly because AI now does the work that used to be a junior's first job (Dice). "I can write React components" isn't the differentiator it used to be.
What employers keep paying for is ownership: developers who can take a product from idea to production, including the database, auth, server logic and deployment, and who can work with AI without being lost when it's wrong. Next.js is one of the most direct ways to build exactly that skill set, because it puts the frontend and the backend in one place.
The bottom line
AI makes good developers faster. It doesn't make understanding optional.
Learn how Next.js actually works, and you'll get far more out of every AI tool you use, because you'll know what to ask for and what to reject.
If you want to start with the concept AI gets wrong most often, watch my free lesson on Server Components below.