fix(docs): drop output: 'standalone' so the production docs build stops failing - #10652
Merged
Merged
Conversation
…tops failing The production build died at the end of `next build` with ENOENT on `apps/docs/.next/next-server.js.nft.json`, so no page merged to `main` was reaching the site. That file is opened by `copyTracedFiles` (next/dist/build/utils.js), reached only from `writeStandaloneDirectory` (next/dist/build/index.js), which Next calls only under `if (config.output === 'standalone')`. Removing the setting removes the only code path that performs that read. Nothing in this repo consumes `.next/standalone`: no Dockerfile, workflow, script or config references the path, and `docker/Dockerfile` does not build apps/docs at all. Vercel does its own serverless packaging, so the setting had no consumer on this deployment target. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GawRwpD44VwBDVy3hs77AX
os-elon
marked this pull request as ready for review
August 21, 2026 07:37
os-elon
enabled auto-merge
August 21, 2026 07:37
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.
Part of #10638. Deliberately not an auto-closing reference: this removes the only
code path that can raise the reported error, but the production deploy itself is not
verifiable from an agent seat, so a human should confirm the site actually serves before
that card closes. The canonical-host half of #10638 is owned elsewhere and is untouched here.
What the production build was doing
The PM's stated mechanism is falsified — measured, not argued
The card's diagnosis was that a Turbopack build does not emit the node-file-trace
.nft.jsonset, makingoutput: 'standalone'and Turbopack a contradiction inside oneconfig. That is false. Running the exact Vercel command
(
cd ../.. && pnpm turbo run build --filter=@objectstack/docs, perapps/docs/vercel.json)on a cold
.nextin a fresh worktree:▲ Next.js 16.3.1 (Turbopack)— the engine said not to emit tracesTasks: 2 successful, 2 total, exit 0, 4m19snext-server.js.nft.json.nft.jsonfiles total.next/standaloneNext's own source agrees:
next/dist/build/adapter/build-complete.js:1369reads// Turbopack traces these itself, they are listed in the nft.json files.So the failure does not reproduce locally, and the config pair is not in itself a
contradiction. Whatever suppresses the trace set is specific to Vercel's builder.
Why this change is still the right fix, on a verified code-path fact
The fix does not rest on the falsified mechanism. It rests on where the throw comes from,
read out of the installed
next@16.3.1:copyTracedFiles—next/dist/build/utils.js:1106,handleTraceFiles(path.join(distDir, 'next-server.js.nft.json')).copyTracedFilesis reached only fromwriteStandaloneDirectory—next/dist/build/index.js:2817.if (config.output === 'standalone')—next/dist/build/index.js:2814.Removing the setting removes the only code path in a production build that opens that
file. This holds regardless of why the trace set is missing under Vercel.
And it costs nothing:
.next/standalonehas zero consumers in this repo —re-verified on a full clone (10555 commits,
is-shallow-repository→false), not theshallow one the card was written from. No Dockerfile, workflow, script or config
references the path, and
docker/Dockerfiledoes not buildapps/docsat all. Verceldoes its own serverless packaging.
When this broke — the staleness window the maintainer asked for
Full history (the card could not date this from a shallow clone):
output: 'standalone'and Next 16 arrived together in the same commit,3124fe9788, 2026-01-19 ("Move documentation site to apps/docs"), atnext@^16.1.3.So the pair is seven months old and was not newly introduced — it cannot by itself
be the trigger.
nextwent 16.2.12 → 16.3.1 on 2026-08-17, in7337f30495(chore(deps)(deps): Bump the production-dependencies group with 19 updates #9212, a Dependabotproduction-dependency batch of 19 updates).
That bump is the only change to the build path in the window, which bounds the outage at
roughly 2026-08-17 → now (~4 days) — i.e. every docs PR merged since 2026-08-17,
including all of epic #10206, has never reached a reader. Worth confirming against the
first red production deploy in the Vercel dashboard.
Verification
Same command, same cold-
.nextprotocol, atdce5c9fb61:Tasks: 2 successful, 2 total, Turbopack, 65s compile.next/standaloneafter.nextafterBUILD_ID,routes-manifest.json,server/,static/, …)There is no red→green demonstration here, and this PR does not claim one — the red
baseline is not reproducible outside Vercel's builder.
Gates re-derived with
node scripts/pm/dispatch-gates.mjs(no path args) after thefinal commit
dce5c9fb61; all seven named families plus the affected-package typecheckand the NUL gate pass:
Note for #10642 (reported, not fixed here)
While reproducing, one premise behind that card turned out to be wrong and is worth
correcting before anyone works it: the
docspath filter atci.yml:79-84listscontent/**as well asapps/docs/**, so content-only commits do scheduleBuild Docs. The filter is not the divergence. The remaining candidates are that CI runspnpm --filter @objectstack/docs builddirectly while Vercel goes throughturbo run build, and that CI restoresapps/docs/.next/cache(ci.yml:1515) whileproduction builds cold. Neither explains an ENOENT that a cold local build cannot
reproduce; the likeliest remaining difference is that Vercel injects a build adapter —
next/dist/server/config-shared.js:190resolvesadapterPathfromprocess.env.NEXT_ADAPTER_PATH, andbuild/index.js:2784-2814runs that adapter'sonBuildCompleteimmediately before the standalone step, with an in-source commentnoting that
output: 'standalone'may become disallowed when such an adapter isconfigured. CI sets no adapter, which is exactly why CI stayed green.
Generated by Claude Code