fix(deploy): opt out of standalone output on Vercel - #2
Merged
Merged
Conversation
`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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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 theVERCELenvironment 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 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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 buildon Linux and passes, and the build is clean locally.Cause
output: "standalone"innext.config.ts. That setting exists for the Docker image, which copies.next/standaloneand runsnode server.js. Vercel produces its own output and does not expect standalone.Fix
Gate it on the
VERCELbuild 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/standaloneemitted (Vercel path).next build→.next/standalone/server.jsstill emitted (Docker path intact).b9c3d5e) — the first successful deploy this project has had.🤖 Generated with Claude Code
https://claude.ai/code/session_01BaSzXHiVdswD9rKoVh9Ln4