Skip to content
Latchkey

Chromatic TurboSnap "could not determine changed files" in CI

TurboSnap decides which stories to snapshot by diffing against the last built commit. That requires real git history. With the default shallow checkout, the ancestor commit is missing, so TurboSnap cannot determine changed files and falls back to a full run or errors.

What this error means

Chromatic logs "TurboSnap could not determine what files changed" or "Failed to retrieve the baseline commit", often alongside a shallow clone.

chromatic
⚠ TurboSnap disabled: could not determine changed files.
The baseline commit is not present in the shallow git history.

Common causes

A shallow clone hides the baseline commit

The default actions/checkout uses fetch-depth: 1, so the commit TurboSnap needs to diff against is not in the local history.

History rewritten or squashed

Squash merges or force pushes can leave the baseline commit unreachable from the current history.

How to fix it

Fetch full git history for the checkout

  1. Set fetch-depth: 0 on the checkout step so full history is available.
  2. Run Chromatic after that checkout.
  3. Confirm TurboSnap now diffs against the baseline.
.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0

Ensure the baseline commit is reachable

If history was rewritten, run a full Chromatic build once to re-establish a baseline TurboSnap can diff against.

Terminal
npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN

How to prevent it

  • Use fetch-depth: 0 in checkout when TurboSnap is enabled.
  • Avoid rewriting history in a way that orphans the baseline commit.
  • Run a full build to re-baseline after major history changes.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →