  In the modern on-shell approach, the perturbative S-matrix is constructed
iteratively using on-shell building blocks with manifest unitarity. As only
gauge invariant quantities enter in the intermediate steps, the notion of gauge
anomaly is absent. In this letter, we rephrase the anomaly cancellation
conditions in a purely on-shell language. We demonstrate that while the
unitarity-methods automatically lead to a unitary S-matrix, the rational terms
that are required to enforce locality, invariably give rise to inconsistent
factorization channels in chiral theories. In four-dimensions, the absence of
such inconsistencies implies the vanishing of the cubic Casimir of the gauge
group. In six-dimensions, if the symmetric trace of four generators does not
vanish, the rational term develops a factorization channel revealing a new
particle in the spectrum: the two-form of the Green-Schwarz mechanism. Thus in
the purely on-shell construction, the notion of gauge-anomaly is replaced by
the difficulty to consistently impose locality on the unitary S-matrix.
