← Back to Library|PromptsDebug a Deployment Failure

Debug a Deployment Failure

Diagnose why your app works locally but fails in production, covering environment differences and build issues.

5-10 min|Intermediate
LaunchQuick WinDeveloper
Prompt Template
My app works locally but fails when deployed. Help me diagnose the issue.

Hosting platform: [Vercel / Railway / AWS / etc.]
Deployment logs:
[paste the deployment or runtime error logs]

What works locally:
[describe the behavior you expect]

What happens in production:
[describe the actual behavior or error]

Environment differences I'm aware of:
- Local Node version: [version]
- Production Node version: [version]
- Environment variables set in production: [list them, without values]
- Database: [local vs production connection details, e.g. local Postgres vs Supabase]

My build command: [e.g. next build]
My start command: [e.g. next start]

Check for these common issues:
1. Missing environment variables in production
2. Build-time vs runtime environment variable access
3. Database connection (local vs remote, SSL requirements)
4. File system differences (case sensitivity, temp directories)
5. Serverless function limitations (timeout, memory, cold starts)

Do NOT suggest 'try redeploying.' Diagnose the actual root cause."

**Output format:** Ranked list of likely causes with fixes.

The explicit environment comparison surfaces differences that are invisible to the AI without this context. The "do NOT suggest redeploying" constraint forces a real diagnosis.

Every time a deployment fails and you can't tell why from the logs alone.