Skip to main content

Next.js analyzer

Next.js Pages → App Router Migration

Detects legacy Pages Router patterns and surfaces App Router migration opportunities.

migrations nextjs-migration

Next.js Pages → App Router Migration

Detects legacy Pages Router patterns and surfaces App Router migration opportunities.

Next.js's App Router supersedes the Pages Router but most codebases live in mixed states during migration. This analysis flags Pages-era patterns (getServerSideProps, getStaticProps, _app.tsx, custom _document.tsx) and points at App Router equivalents (Server Components, layouts, metadata API, route handlers).

Severity guide

info
A legacy pattern is present but not blocking.
warning
A legacy pattern should be migrated to the App Router equivalent.
critical
A pattern is incompatible with current Next.js versions or actively breaking.

Remediation

Migrate the flagged pattern to the App Router equivalent. Reference the Next.js migration guide for each pattern.

Common migrations: getServerSideProps → async Server Component with no caching; getStaticProps → async Server Component with static rendering; _app.tsx → root layout; _document.tsx → app/layout.tsx; API routes → route handlers under app/.

Documentation