Output Types
Core Idea
Full schema reference for every entry in the outputs object passed to onBuildComplete: pages, pagesApi, appPages, appRoutes, prerenders, staticFiles, middleware.
Key Concepts
outputs.pages / pagesApi / appPages / appRoutes: share a common shape — id, filePath, pathname, sourcePage, runtime: 'nodejs' | 'edge', assets, wasmAssets?, edgeRuntime?, config (maxDuration?, preferredRegion? deprecated, env?).
outputs.prerenders: ISR/static prerender entries — parentOutputId, groupId (shared revalidation group), route (template with dynamic segments), routeType (route|fallback|shell|page), response (empty|initial|complete), compute (blocking|resuming|static), htmlSize?, pprChain?, fallback?, config (allowQuery, allowHeader, bypassFor, renderingMode, partialFallback, bypassToken).
outputs.staticFiles: id, filePath, pathname, immutableHash? (content hash indicating immutability).
outputs.middleware: middleware.ts/proxy.ts function, always pathname: '/_middleware', includes config.matchers.
output: 'export' special case: only outputs.staticFiles is populated; all other arrays are empty.
Reference Tables
| routeType | Meaning |
|---|
route | Non-UI route (Route Handler) |
page | Page with no missing prerenderable params |
shell | Most specific reusable page shell for a URL class |
fallback | Reusable response specializable by filling more params |
| response | Meaning |
|---|
empty | No initial page response can be served |
initial | Initial response servable, not the completed UI (partial prerender) |
complete | Response is complete (can be zero-byte, e.g. 204) |
| compute | Meaning |
|---|
blocking | No initial response before request-time compute starts (then streams) |
resuming | Initial response served while postponed work resumes server-side |
static | No per-request server compute needed |
Anti-patterns
- Assumir que
pages/appPages/etc. terão dados quando output: 'export' estiver ativo: só staticFiles é populado nesse modo.
- Ignorar
routeType/response/compute: eles só aparecem na resposta primária de um grupo de prerender; outputs relacionados de RSC/data/segment os omitem.
Key Takeaways
groupId agrupa prerenders que revalidam juntos.
htmlSize só existe no output HTML primário do App Router; 0 significa shell HTML vazio.
- Todo output com
runtime: 'edge' carrega edgeRuntime com a metadata canônica pra invocação (ver Invoking Entrypoints).
Connects To
- Invoking Entrypoints (ch440): consome
edgeRuntime de cada output.
- Routing with @next/routing (ch438): usa
pathname de vários desses outputs como input.