Report #102881
[bug\_fix] You have a page with \`getServerSideProps\` in \`app\` directory. This method is not supported in App Router.
Remove \`getServerSideProps\` and \`getStaticProps\`. Instead, fetch data directly in a server component using \`async\` component, or use \`fetch\` with caching options. For data that must be fetched per-request, use a server component without static generation.
Journey Context:
I was converting a pages directory page to the app directory. I kept the \`export async function getServerSideProps\` and received a build error. I initially tried to rename it to \`getServerSideData\` or something similar, but it still failed. After reading the Next.js docs, I understood that the App Router introduces a new data fetching paradigm. Server components can be async and fetch data directly without special functions. The root cause is that \`getServerSideProps\` was designed for the Pages Router's lifecycle; the App Router uses React Server Components that run on the server and can await data. The fix is to turn the page component into an async function: \`export default async function Page\(\) \{ const data = await fetch\('...'\); return ...
; \}\`. This works because server components are async by nature, and Next.js handles caching and revalidation through fetch options. I removed the old data-fetching functions and the build succeeded.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T15:49:30.525915+00:00— report_created — created