Build output and next build
Read the route table next build prints, know what each symbol means, what lands in .next, and which flags help when a build fails or a route is not static.
Build output and next build
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- next build compiles the app, classifies every route as static or on demand, prerenders what it can, writes the result to .next, and prints a route table.
- The route table symbols are ○ Static, ● SSG (paths from generateStaticParams or getStaticProps), and ƒ Dynamic; with Cache Components a route can also be ◐ Partial Prerender.
- A route becomes ƒ when it reads request-time data such as cookies() or headers(); the table is the fastest way to see whether a page you meant to be static actually is.
- next build checks TypeScript but no longer runs linting, and NEXT_PUBLIC_ variables are inlined into the client bundle at build time.
- --debug-prerender and --debug-build-paths narrow a failing build down; do not deploy a build made with --debug-prerender.
The build is where static is decided
In development a route is rendered when you request it. In production, someone has to decide ahead of time which pages are plain files and which need a server. That decision happens in next build, once, and the route table at the end is its report. If you can read that table, you can tell what your deployment will do before you deploy it.
What the build does
The docs list six phases. Setup loads .env files, validates next.config, and generates a build ID. Route discovery scans app/ and pages/ and picks up root files such as proxy and instrumentation. Compilation bundles client, server, and edge code with Turbopack. Static analysis classifies each route and collects generateStaticParams output. Prerendering produces HTML and the payloads used for client-side navigation. Output writes everything to .next/.
TypeScript is type-checked during the build, and a type error fails it unless you set typescript.ignoreBuildErrors. Linting is not part of it: next lint was removed in 16 and next build does not run it.
Reading the route table
I built a small app on 16.4.6 with a home page, a /blog/[slug] route with generateStaticParams, a page that calls cookies(), a route handler, and a proxy.ts. It printed:
Route (app)
┌ ○ /
├ ○ /_not-found
├ ƒ /api/ping
├ /blog/[slug]
│ ├ ● /blog/a
│ └ ● /blog/b
└ ƒ /dashboard
ƒ Proxy (Middleware)
○ (Static) prerendered as static content
● (SSG) prerendered as static HTML (uses generateStaticParams)
ƒ (Dynamic) server-rendered on demand
Three symbols carry most of the meaning.
○Static. The whole route was prerendered to HTML at build time.●SSG. A dynamic segment whose paths were listed bygenerateStaticParams. Each prerendered path appears under the pattern.ƒDynamic. Rendered on each request./dashboardis here because it readscookies(), and the route handler is here because it is not marked static.
Route handlers, the proxy, and dynamic metadata images such as opengraph-image also use ƒ. The table in my build had no file-size columns, so do not go looking for them; use bundle analysis for size.
The ƒ next to /dashboard is the useful signal. Nobody typed “make this dynamic”; reading a cookie did it. When a page you thought was static shows ƒ, look for a request-time read in that page or any layout above it. Dynamic APIs lists them.
With Cache Components on
New projects from create-next-app enable Cache Components, and the docs describe a different set of symbols for it. Partial Prerendering becomes the only model for App Router pages: ○ is fully prerendered, ◐ is a static shell with the rest rendered on demand, and ƒ means the build accepted an empty prerender and the route renders on request. Routes with use cache can also show Revalidate and Expire columns. Both come from the docs; I only checked them in the Pages Router case, where my build did show Revalidate 1m and Expire 1y for a getStaticProps page with revalidate: 60. Partial prerendering covers the model.
The build also validates. I turned on cacheComponents: true and added app/posts/[id]/page.tsx that awaited params and rendered it. The build failed:
Error: Route "/posts/[id]": Next.js encountered uncached or runtime data during prerendering.
...
- [stream] Provide a placeholder with `<Suspense fallback={...}>` around the data access
- [cache] For uncached data (`fetch`, database calls): cache the access with `"use cache"` (does not apply to `connection()`)
- [block] Set `export const instant = false` to allow a blocking route
The error lists three ways out: stream it behind Suspense, cache it, or declare the route blocking on purpose. Choosing among them is the subject of cache components and use cache.
What lands in .next
next start serves the contents of .next. In my build that included BUILD_ID, static/ for hashed client assets, server/ for compiled server code and prerendered HTML and RSC payloads, manifests such as routes-manifest.json and prerender-manifest.json, and cache/. Treat it as an opaque artifact you ship whole; the one part worth knowing is .next/cache, the build cache, because CI should persist it between runs. The docs show CircleCI, Travis, and GitLab snippets, and say Vercel handles it for you.
Two build-time facts catch people out. NEXT_PUBLIC_ variables are inlined into the JavaScript bundle during next build, so changing one means rebuilding. And next dev keeps its own state in .next/dev, so deleting .next resets it. Environment variables covers the first.
Flags for a build that misbehaves
next build --help on 16.4.6 lists these, and the first three are in the docs:
--debug-prerender: disables server minification, enables server source maps, and prevents one failed route from stopping the rest. The docs warn not to deploy builds made with it.--debug-build-paths <patterns>: builds only the paths or globs you give, with!to exclude. Useful on a large app; combine it with--debug-prerenderto get a stack that points at your source line.--webpackand--turbopack: pick the bundler. Turbopack is the default in 16.--analyze: bundle analysis, Turbopack only.--debug: more verbose output.
What the video covers
Codevolution’s video is part of a Next.js 15 series and this lesson embeds the “Analyzing the Build Output” chapter, 3:08 to 7:31. From its description and chapters, the full video explains static rendering, the difference between development and production servers, how routes are prerendered, how assets show up in the build output, and prefetching. Transcripts were unavailable, so this lesson claims nothing about the narration beyond that.
It was recorded on Next.js 15, so the log format differs from 16: expect different columns and the newer symbols above. The idea of reading a route table to see what is static still holds. It was the only candidate sourced for this node, and it is only partly on topic. Treat the prose here as the primary source.
Where this fits
Rendering decisions are now something you can inspect, not guess. Next is where the output goes: deploying to Vercel, then running it yourself in self-hosting with Node.js and Docker.
Check yourself
A page you expected to be static shows ƒ in the route table. What is the usual cause and how do you confirm it?
The route reads request-time data, such as cookies(), headers(), or searchParams, which makes Next.js render it on each request. Removing or moving that read, or looking for it in the page and its layouts, and rebuilding should flip the symbol.
What do ○ and ● mean, and when does a dynamic route show ●?
○ is a route prerendered as plain static content. ● is a route whose paths were prerendered from generateStaticParams (or getStaticProps in the Pages Router), so a [slug] route lists each prerendered path beneath it.
Why is a build made with --debug-prerender unsafe to deploy?
It disables server minification, turns on server source maps, and lets one failed route not stop the rest of the build, so the output is for debugging rather than production.
Where do you set up caching so CI builds are not always cold?
Persist .next/cache between CI runs. Next.js writes its build cache there, and a CI that discards it will rebuild everything and may warn that no cache was detected.
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.