new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Next.js App Router · all subjects

build & deployment

17 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Static export deployment

Next.js can be deployed and hosted as a static site on any web server that can serve HTML/CSS/JS static assets, including AWS S3, Nginx, or Apache. Static export does not support Next.js features that require a server.

Next.js deployment options

Next.js can be deployed as a Node.js server, Docker container, static export, or adapted to run on different platforms. Node.js server and Docker container deployments support all Next.js features. Static export has limited feature support. Adapters have varying feature support depending on whether they are verified adapters.

Node.js server deployment setup

To deploy Next.js to a Node.js server, ensure your package.json has "build" and "start" scripts. The build script should be "next build" and the start script should be "next start". Run npm run build to build the application and npm run start to start the Node.js server. Node.js deployments support all Next.js features.

Docker deployment of Next.js

Next.js can be deployed to any provider that supports Docker containers, including container orchestrators like Kubernetes or cloud providers that run Docker. Docker deployments support all Next.js features. For best practices on containerizing Next.js apps, refer to Docker's official Next.js and React.js guides. During development on Mac and Windows, using local development (npm run dev) is recommended for better performance than Docker.

Docker deployment templates and examples

Docker Standalone Output example uses output: "standalone" to generate a minimal, production-ready Docker image with only required runtime files and dependencies. Docker Export Output example uses output: "export" to generate optimized HTML files for static hosting. Docker Multi-Environment example manages separate Docker configurations for development, staging, and production with different environment variables.

Verified adapters for Next.js

Verified adapters are open source, run the full Next.js compatibility test suite, and are hosted under the Next.js GitHub organization. The Next.js team coordinates testing with verified adapters before major releases. Current verified adapters include Vercel and Bun. Cloudflare and Netlify are working on verified adapters but currently offer their own Next.js integrations.

Deployment Adapter API

The Deployment Adapter API allows platforms to customize how Next.js applications are built and deployed by adapting Next.js to run on different platform infrastructures.

Platform-specific Next.js integrations

Appwrite Sites, AWS Amplify Hosting, Cloudflare, Deno Deploy, Firebase App Hosting, and Netlify offer their own Next.js integrations that are not built on the public Adapter API and are not verified by the Next.js team. Feature support and compatibility may vary across these platforms.

Dev overlay validation for prerendering

Next.js requires explicit handling of components that can't complete during prerendering. It surfaces a validation insight in the dev overlay and dev server console that names the route and points at fixes: cache the access, move it into a Suspense boundary, or opt the route out. This validation keeps every route producing a static shell.

Bots and crawlers handling

Browsers receive the static shell instantly. Bots and crawlers are detected by user agent and handled differently: because they need a complete document, Next.js skips the shell and renders the entire page dynamically at request time, then sends the finished HTML once render completes.

Data availability for bots and crawlers

Because the shell is re-rendered for bots instead of reused, work that completed during prerendering now runs at request time for a bot. Ensure the data your shell relies on is also available at request time, not only during build time or prerendering.

Build time definition

Build time is the stage when your application is being compiled. During build time, Next.js transforms your code into optimized files for production, generates static pages, and prepares assets for deployment.

File-system caching with Turbopack

File-system caching is a Turbopack feature that stores compiler artifacts on disk between runs, reducing work across next dev or next build commands for significantly faster compile times.

Static Export deployment mode

Static Export is a deployment mode that generates a fully static site with HTML, CSS, and JavaScript files. It is enabled by setting output: 'export' in next.config.js. Static exports can be hosted on any static file server without a Node.js server.

Turbopack bundler for Next.js

Turbopack is a fast, Rust-based bundler built for Next.js. It is the default bundler for next dev and available for next build. It provides significantly faster compilation times compared to Webpack.

Version skew definition and handling

Version skew occurs after a new version of an application is deployed, when clients that are still active may reference JavaScript, CSS, or data from an older build. This mismatch between client and server versions can cause missing assets, Server Action errors, and navigation failures. Next.js uses deploymentId to detect and handle version skew.

next-code-frame design without turbo-tasks dependency

The next-code-frame crate follows the next-taskless pattern with no dependency on turbo-tasks, allowing use in webpack and rspack codepaths. It is compilable to WASM for environments without native bindings and follows sans-io patterns where the library accepts file content as arguments rather than performing IO.

Give your agent this brain