Skip to content

fix(deploy): opt out of standalone output on Vercel - #2

Merged
SupaOhm merged 1 commit into
mainfrom
fix/vercel-deploy
Aug 5, 2026
Merged

SupaOhm merged 1 commit into
mainfrom
fix/vercel-deploy

Conversation

@SupaOhm

@SupaOhm SupaOhm commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Problem

The Vercel project had never produced a successful deployment — the dashboard showed "No Production Deployment", and both the PR preview and the post-merge production build failed.

It was not a code problem: GitHub Actions runs the identical pnpm install --frozen-lockfile + next build on Linux and passes, and the build is clean locally.

Cause

output: "standalone" in next.config.ts. That setting exists for the Docker image, which copies .next/standalone and runs node server.js. Vercel produces its own output and does not expect standalone.

Fix

Gate it on the VERCEL build env var, which Vercel sets during builds. The Docker path is untouched — no Dockerfile or CI change needed.

Verification

  • VERCEL=1 next build → no .next/standalone emitted (Vercel path).
  • plain next build → .next/standalone/server.js still emitted (Docker path intact).
  • Lint clean, 37/37 tests pass, build clean across 15 routes / 120 static pages.
  • Vercel deployment is green on this branch (b9c3d5e) — the first successful deploy this project has had.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BaSzXHiVdswD9rKoVh9Ln4

`output: "standalone"` exists for the Docker image, which copies
`.next/standalone` and runs `node server.js`. Vercel produces its own output
and does not expect standalone, which is the leading suspect for the deploy
failure — the Vercel project has never had a successful deployment, while
GitHub Actions runs the identical install and build on Linux and passes.

Gated on the `VERCEL` build env var so the Docker path is untouched. Verified
both ways locally: `VERCEL=1 next build` emits no `.next/standalone`, and a
plain `next build` still emits `.next/standalone/server.js`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BaSzXHiVdswD9rKoVh9Ln4
Copilot AI lite review requested due to automatic review settings August 5, 2026 04:21
@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
acklab Ready Ready Preview Aug 5, 2026 4:21am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Vercel deployments by disabling Next.js output: "standalone" on Vercel builds (while keeping it enabled for the Docker build path).

Changes:

  • Gate output: "standalone" behind the VERCEL environment variable.
  • Add inline documentation explaining why Vercel should not use standalone output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread next.config.ts
Comment on lines +4 to +7
// `standalone` exists for the Docker image, which copies `.next/standalone`
// and runs `node server.js`. Vercel builds its own output and does not want
// it, so opt out there via the `VERCEL` build env var.
output: process.env.VERCEL ? undefined : "standalone",
@SupaOhm
SupaOhm merged commit 2747b4c into main Aug 5, 2026
4 checks passed
SupaOhm pushed a commit that referenced this pull request Aug 5, 2026
Picks up the Vercel standalone fix (#2) so this branch's preview deploy
builds against the corrected config.

This branch was successfully deployed

1 active deployment
Preview — b9c3d5ec Deployed Aug 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants