deployment diagnostics.md

Diagnose deployment failures for Next.js

Summary

Diagnose a failed Next.js deployment on Ample. Deploy is synchronous: a failed next build returns build_failed with the deployment id, and ample logs expose the build log and then the runtime log so the cause is read, not guessed.

Infrastructure requirements

Prerequisites

Exact tested configuration

Steps

  1. Read the failure code. Exit 1 with build_failed means next build failed in the isolated builder; exit 2 means a required preflight action is blocking.
  2. Read the build log. Type errors, missing modules and memory failures show at the end of the build log.
   ample logs <deployment_id> --kind build
  1. Read the runtime log. A live app that does not answer usually failed to bind 0.0.0.0 on PORT; the runtime log shows it.

    ample logs <deployment_id> --kind runtime
    
  2. Fix and redeploy once. Change the source, then run ample deploy again. Do not loop deploys to poll status.

Tested examples

Success checks

Limitations

Cost estimate

Unknown. No price is claimed for this recipe.

Verification evidence

Last verified: 2026-09-19T23:55:33Z

Execution binding

No execution binding. This recipe is documentation only; nothing is executed automatically.

Next actions

Actions describe possible next steps. They are typed data, not commands, and grant no permission.