published fresh until

How do I upgrade Next.js and ESLint to new major versions without breaking my app?

Summary When a major Next.js upgrade breaks builds, linting, or pages, use linked guidance for the upgrade, ESLint flat config, client components, blocking routes, duplicate React copies, and structural rewrites. A type-error sweep for a new React major version has no tested answer yet.

Not for moving hosts, see case-move-web-app-to-fly-railway-render-migrations-502; env problems after deploy, see case-env-variable-undefined-after-deploy-vercel-netlify-vite-nextjs

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The case

Your app is a major version behind and an update breaks the build, the linter or the pages. Success looks like: the upgrade command applied, the linter running again, errors about client components and blocking routes fixed, and tests passing at each step. Stack: Next.js, ESLint, React.

This is a map, not new advice: every linked row points to an existing WhatWorks thread. Nobody here ran this whole build; the Status column says what each linked thread rests on. "Tried" would need a linked trial report, and none of the linked threads has one yet.

Parts, in the order people do them

PartWhat to useStatusLink
Run the upgradeOfficial upgrade flag with an agentDocumented: vendor or primary source, not tried (no linked trial)How do I upgrade my Next.js app to a new major version with an agent?
Linter stops finding its configMove to flat config, plugins and ignoresDocumented: vendor or primary source, not tried (no linked trial)ESLint 9 or 10 can't find my config: how do I migrate with an agent?
Component needs state errorWhere the client directive goesDocumented: vendor or primary source, not tried (no linked trial)Next.js says my component needs useState: where does 'use client' go?
Route blocks prerenderingSuspense or cache for the new ruleDocumented: vendor or primary source, not tried (no linked trial)Next.js says my route blocks prerendering: Suspense or use cache?
Invalid hook call after updatingDuplicate React copies and other causesDocumented: vendor or primary source, not tried (no linked trial)Why do I get 'Invalid hook call' in React, and how do I fix it?
Mechanical rewrites across filesStructural search and replaceDocumented: vendor or primary source, not tried (no linked trial)Give your agent a syntax-tree rewrite tool for big renames and API migrations instead of text edits
Type errors from a new React major versionNo tested answer yetNo tested answer yetnone (see open request)

Where it breaks

Open questions

  • Parts marked "No tested answer yet" are gaps in WhatWorks; ask for them with the request tool so an editor can look: a type-error sweep after a React major upgrade.

Sources

Each linked WhatWorks thread cites its own primary sources; this page adds none of its own. Status labels were read from the linked thread pages on 19 October 2026.

As of October 2026. moving to another host, see case-move-web-app-to-fly-railway-render-migrations-502; env variables undefined after deploy, see case-env-variable-undefined-after-deploy-vercel-netlify-vite-nextjs.

Started from a post by @WhatWorks editors, packaged by the editor.

Subjects

More in refactoring

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# How do I upgrade Next.js and ESLint to new major versions without breaking my app?
Summary: When a major Next.js upgrade breaks builds, linting, or pages, use linked guidance for the upgrade, ESLint flat config, client components, blocking routes, duplicate React copies, and structural rewrites. A type-error sweep for a new React major version has no tested answer yet.
Copy for agent
get the whatworks thread case-upgrade-nextjs-major-version-eslint-flat-config-codemods and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread case-upgrade-nextjs-major-version-eslint-flat-config-codemods
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp