docs: correct the claim that Turbopack ignores outputFileTracingIncludes - #247
Merged
Merged
Conversation
Two documents said Next skips trace collection under Turbopack and concluded the option therefore never runs. The first half is true and the conclusion does not follow: `collectBuildTraces` is skipped, but Turbopack emits the `.nft.json` files and applies the include globs itself. Measured against a Turbopack build of this app rather than argued from `next/dist`: `next-server.js.nft.json`, which the `'/**'` key does not cover, lists three `@swc/helpers` entries and none under `esm/`; a route's `.nft.json`, which it does cover, lists over a thousand including 324 under `esm/` and the package's `LICENSE`, a file no tracer would follow. The glob is load-bearing, not dead code, and the gate guarding its pinned version guards something real. That reading also produced a false explanation for the missing migration `.sql` files on Vercel. They are absent because nothing imports them and nothing lists them, not because the mechanism is unavailable — the schema-check the installer now does stands on its own arguments, which were always the better ones. And the reason `output: 'standalone'` broke the Vercel build is recorded as unestablished rather than explained by a mechanism that does not hold. The positive fact is written down beside the glob it explains, because reading `next/dist` alone leads to the wrong conclusion twice.
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.
MEI-134's premise was wrong, and it was mine. This corrects the record rather than implementing the ticket.
The claim
Two documents said, in different words, that
outputFileTracingIncludesnever executes:The reasoning came from
next/dist/build/index.js:1627, which is real:collectBuildTracesis skipped. The conclusion does not follow — Turbopack emits the.nft.jsonfiles and applies the include globs on its own side. The option is handled innext/distonly bycollectBuildTraces, which is exactly why reading that far is misleading.The measurement
Against a real Turbopack build of
apps/community(chunkLoadingGlobal: "TURBOPACK"), not argued from source:'/**'key?@swc/helpersentriesesm/next-server.js.nft.jsonserver/app/admin/log/page.js.nft.jsonThe covered one also lists the package's
LICENSE— a file no tracer would ever follow. That is the glob, not tracing.What this changes
Nothing in the build. The glob in
apps/community/next.config.mjsis load-bearing: it is the only thing putting@swc/helpers/esminto the standalone tree, and without it self-hosted and Docker boards fail at request time withCannot find module '@swc/helpers/esm/…'. MEI-120's gate on its pinned version guards something real. Both stay exactly as they are — which is the point of correcting this, since the ticket as filed proposed removing them.Two consequences for prose:
.sqlfiles on Vercel was wrong. They are absent because nothing imports them and nothing lists them, not because the mechanism is unavailable. MEI-133's schema check stands on its own arguments — lock contention across cold starts, function timeouts — which were always the better ones.output: 'standalone'broke the Vercel build is now recorded as unestablished. The failure was real and reproducible; the mechanism given for it does not hold, and I could not determine the true one without a Vercel build.The positive fact is written down beside the glob it explains, because reading
next/distalone leads to the wrong conclusion — it did so twice.Still open
Whether Turbopack emits
.nft.jsonwhenoutputis unset, which is today's Vercel configuration. Everything measured here came from a build withoutput: 'standalone', and the emission condition lives in the Rust binary. If it turns out nft files are not emitted there, the glob is inert on Vercel specifically while remaining load-bearing for Docker and self-hosting. Recorded on MEI-134; onenext buildwithVERCEL=1settles it.Verification
docs:links:check,docs:index:checkandsite:docs:checkall pass. Documentation only — no code changes.Generated by Claude Code