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.
⚠ 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
- Set
fetch-depth: 0on the checkout step so full history is available. - Run Chromatic after that checkout.
- Confirm TurboSnap now diffs against the baseline.
- uses: actions/checkout@v4
with:
fetch-depth: 0Ensure the baseline commit is reachable
If history was rewritten, run a full Chromatic build once to re-establish a baseline TurboSnap can diff against.
npx chromatic --project-token=$CHROMATIC_PROJECT_TOKENHow to prevent it
- Use
fetch-depth: 0in 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.