DEV Community

Cover image for Turborepo, Nx and Vite Task undo your commit on a cache hit
VX
VX

Posted on Originally published at vznjs.github.io

Turborepo, Nx and Vite Task undo your commit on a cache hit

Commit a file that lives in a task's output folder, then build. Turborepo
puts the old copy back and calls it FULL TURBO:

$ git log -1 --oneline -- packages/site/out/LICENSE
aa424fd v3
$ turbo run build
   • turbo 2.11.10
   • Packages in scope: site
   • Running build in 1 package
   • Remote caching disabled
site:build: cache hit, replaying logs d02065a43c947846
site:build: $ cat src/*.txt > out/index.txt
 Tasks:    1 successful, 1 total
Cached:    1 cached, 1 total
  Time:    5ms >>> FULL TURBO
$ git diff --stat
 packages/site/out/LICENSE | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Enter fullscreen mode Exit fullscreen mode

Turborepo 2.11.10 · inputs: ["src/**"], outputs: ["out/**"] · out/LICENSE committed · setup warnings cut · 2026-11-10

out/LICENSE is source. The build never writes it. The cache kept a
copy anyway, and the hit restored it over your commit.

Four of six tools lose the commit

Case vx moon Turborepo Nx Vite Task Nix
committed edit under the outputs kept pass pass fail fail fail fail
committed chmod +x under the outputs kept pass pass fail fail fail fail
force-added file under ignored outputs kept pass pass fail fail fail fail

Turborepo 2.11.10 · Nx 24.0.2 · Vite Task 1.4.0 · moon 2.6.5 · Nix 2.34.6 · conformance cases, compiled from the test suites of Nx, Turborepo, Vite Task, moon, Nix and vx

Nix fails another way: it drops LICENSE from the tree. The run stays
green in every tool, so nobody sees it until review.

Where it bites

diagram

A CNAME in the site's output folder, a hand-written .d.ts in dist/,
a vendored file in lib/. Each is tracked by git and sits under an
output glob.

vx keys what git tracks under the outputs

The same project under vx, after committing a new out/LICENSE:

$ vx run build --all
  Tasks     status  cache     ±usual    time   cpu    mem outputs  blocks worker  task
            success miss        −2ms     7ms   29%      —     17B       0 local  packages/site#build
$ git diff --stat
$ cat packages/site/out/LICENSE
license v2
Enter fullscreen mode Exit fullscreen mode

vx treats a tracked file under an output glob as part of the key. Your
commit changes the key, the task runs, and LICENSE stays as committed.

Every case and each tool's detail: Conformance.
More at vznjs.github.io/vx.


Originally published on the vx blog. vx is open-source (MIT) task orchestration with a build cache: vznjs.github.io/vx · GitHub.

Written with AI assistance.

Top comments (0)