Will It Vibe logoWill It Vibe?
NEXT-021Low severity-4 points

Legacy getInitialProps disables static optimization

Part of Architecture & Best Practices, which counts for 15% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.

What it detects

getInitialProps on a page opts the whole route out of Automatic Static Optimization, forcing server rendering on every request even for otherwise static content. Modern data fetching (getServerSideProps/getStaticProps or the App Router) avoids this.

Why it matters

Defining getInitialProps on a page opts that route out of Automatic Static Optimization, so Next.js server-renders it on every request even when the content could have been static or incrementally regenerated. It also runs on both server and client, which complicates data handling. It is a legacy pattern kept mainly for backward compatibility.

How to fix it

Replace getInitialProps with getStaticProps (optionally with revalidate) for content that can be prerendered, or getServerSideProps for genuinely per-request data. For new work, prefer moving the route to the App Router where server components fetch data directly.

The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing

Does your repo trip this check?

Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.

Scan your repo

Related Architecture & Best Practices checks