vercel/next.js · error · Error
getServerSideProps cannot be used with "output: export". See
Error message
getServerSideProps cannot be used with "output: export". See more info here: https://nextjs.org/docs/advanced-features/static-html-export
What it means
Config-combination guard in renderToHTMLImpl: the page exports getServerSideProps (per-request server rendering) while nextConfig.output === 'export', which produces a purely static bundle with no runtime server. These are fundamentally incompatible, so render-time validation rejects the combination; the data-fetching method must be changed or the output mode removed.
Source
Thrown at packages/next/src/server/render.tsx:589
getCacheControlHeader({ revalidate: false, expire: expireTime })
)
isAutoExport = false
}
if (hasPageGetInitialProps && isSSG) {
throw new Error(SSG_GET_INITIAL_PROPS_CONFLICT + ` ${pathname}`)
}
if (hasPageGetInitialProps && getServerSideProps) {
throw new Error(SERVER_PROPS_GET_INIT_PROPS_CONFLICT + ` ${pathname}`)
}
if (getServerSideProps && isSSG) {
throw new Error(SERVER_PROPS_SSG_CONFLICT + ` ${pathname}`)
}
if (getServerSideProps && renderOpts.nextConfigOutput === 'export') {
throw new Error(
'getServerSideProps cannot be used with "output: export". See more info here: https://nextjs.org/docs/advanced-features/static-html-export'
)
}
if (getStaticPaths && !pageIsDynamic) {
throw new Error(
`getStaticPaths is only allowed for dynamic SSG pages and was found on '${pathname}'.` +
`\nRead more: https://nextjs.org/docs/messages/non-dynamic-getstaticpaths-usage`
)
}
if (!!getStaticPaths && !isSSG) {
throw new Error(
`getStaticPaths was added without a getStaticProps in ${pathname}. Without getStaticProps, getStaticPaths does nothing`
)
}
if (isSSG && pageIsDynamic && !getStaticPaths) {View on GitHub (pinned to 89d017eac4)
Solutions
- Remove `getServerSideProps` from the page, or remove `output: "export"` from next.config if server rendering is needed.
- Migrate to `getStaticProps`/`getStaticPaths` if the data can be fetched at build time.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/next/src/server/render.tsx:591 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of vercel/next.js@89d017eac4 (2026-08-19).
Data as JSON: /api/errors/b5e29969b4641b0c.
Report an issue: GitHub.