vercel/next.js · error · Error
Error for page ${page}: pages with `getServerSideProps` can
Error message
Error for page ${page}: pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export What it means
Static-export incompatibility check in exportPagesPage: the page being exported defines getServerSideProps, which requires a per-request Node server. next export cannot execute it, so export is refused up front rather than silently emitting a page with missing props.
Source
Thrown at packages/next/src/export/routes/pages.ts:49
res: MockedResponse,
path: string,
page: string,
query: NextParsedUrlQuery,
params: Params | undefined,
htmlFilepath: string,
htmlFilename: string,
pagesDataDir: string,
buildExport: boolean,
isDynamic: boolean,
sharedContext: PagesSharedContext,
renderContext: PagesRenderContext,
hasOrigQueryValues: boolean,
renderOpts: RenderOpts,
components: LoadComponentsReturnType,
fileWriter: MultiFileWriter
): Promise<ExportRouteResult | undefined> {
if (components.getServerSideProps) {
throw new Error(`Error for page ${page}: ${SERVER_PROPS_EXPORT_ERROR}`)
}
// for non-dynamic SSG pages we should have already
// prerendered the file
if (!buildExport && components.getStaticProps && !isDynamic) {
return
}
// Pages router merges page params (e.g. [lang]) with query params
// primarily to support them both being accessible on `useRouter().query`.
// If we extracted dynamic params from the path, we need to merge them
// back into the query object.
const searchAndDynamicParams = {
...query,
...params,
}
if (components.getStaticProps && !htmlFilepath.endsWith('.html')) {View on GitHub (pinned to 0eb3775416)
Solutions
- Remove getServerSideProps from the page, or drop output: export.
Defensive patterns
Strategy: validation
When it happens
Trigger: Exporting a pages/ page that defines getServerSideProps.
Common situations: Running next export on an app that still uses getServerSideProps.
AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19).
Data as JSON: /api/errors/363153844d3a5295.
Report an issue: GitHub.