Troubleshooting

"Missing parent" thrown for paginated data

If your data source is paginated (e.g. GitHub REST), some commits will reference parents that haven't been fetched yet. Pass the option through validate, or rely on the component's default which calls validate internally:

import { validate } from "@/components/git-graph/lib/validate";

validate(commits, { allowMissingParents: true });

Unsorted commits

Not a problem — GitGraph topologically sorts on the fly. You can pass commits in any order; the rendered order is determined by parent relationships and timestamp ties.

HEAD sha not found

Passing a head prop whose sha isn't in commits throws GitGraphInputError with kind: "head-not-found". Either omit the prop or ensure the HEAD commit is included in the array.

Tailwind v4 token not picked up

GitGraph's CSS uses raw hsl() values, not Tailwind tokens — but if you re-theme using Tailwind v4's @theme variables, ensure your globals.css imports happen before git-graph.css so cascade order resolves the way you expect:

/* app/layout.tsx */
import "./globals.css";
import "@/components/git-graph/git-graph.css";