The dev server working smoothly is no guarantee that production will too. Problems like a missing server at build time, a missing environment variable, or a dynamic API mistakenly treated as static only tend to surface once you actually run next build.
The key idea
Before every release, run typecheck, tests, and next build in a clean environment. After building, use next start to try production-like mode and check the important routes, forms, images, and metadata. Verify environment variables, database migrations, backups, security headers, error monitoring, and that a rollback version exists. Don't dismiss build warnings just because they're not errors — understand the cause before accepting them.
Let's try it together
pnpm typecheck
pnpm test
pnpm build
pnpm start
# Browser တွင်စစ်ရန်
# http://localhost:3000How the code works
pnpm build produces an optimized output and catches build-time errors. pnpm start runs that output in production mode. Do a smoke test in the browser before shipping to hosting.
The production build succeeds, and key user flows work in production-like mode.5-Minute Try-It
Write a ten-item pre-deploy checklist for your project, specific enough that a teammate could follow it exactly.
Next.js — Production Checklist — Next.js