Question presented to candidate: "We run a Next.js 15 App Router app in production. Management wants us on 16 this sprint. Walk me through what will break, in what order you would tackle it, and how you would know the upgrade is actually done."
What a strong answer should cover:
- Requirements: Node.js 20.9+, TypeScript 5.1+, current
react/react-domand their types; Turbopack becomes the default fornext devandnext build, and a customwebpackconfig with noturbopackconfig fails the build. - Removals: synchronous
params,searchParams,cookies(),headers()anddraftMode();next lintand theeslintconfig key; AMP;serverRuntimeConfigandpublicRuntimeConfig;experimental.ppr,experimental.dynamicIOandunstable_rootParams. - Renames and new defaults:
middleware.tsbecomesproxy.ts(Node.js runtime),revalidateTagneeds a second argument, parallel route slots needdefault.js, andnext/imagegets stricter defaults. - Process: run
npx @next/codemod@canary upgrade latest(plus the async request API codemod if needed), then fix what the build and type check report, then test runtime behaviour, because some breakages are silent. - 16.4 adds
next upgrade --agent, which prepares the version guides and hands the migration to a coding agent.
Clarifying questions expected:
- "Do we use a custom webpack config, edge middleware or AMP?" β those are the riskiest items.
- "Which Next.js 15 minor are we on, and did we adopt PPR canaries?" β PPR from 15 canaries has no direct equivalent.
Code / implementation expected: Yes β the codemod commands and before/after for async params and the config.