  Large dust reservoirs (up to $\sim 10^8 \, \mathrm{M_\odot}$) have been
detected in galaxies out to redshift $z \sim 8$, when the age of the universe
was only about 600 Myr. Generating significant amounts of dust within such a
short timescale has proven challenging for theories of dust formation and has
prompted the revision of the modelling of potential sites of dust production
such as the atmospheres of asymptotic giant branch (AGB) stars in
low-metallicity environments, supernovae (SNe) ejecta, and the accelerated
growth of grains in the interstellar medium (ISM). However, degeneracies
between different evolutionary pathways remain when the total dust mass of
galaxies is the only available observable. Here we report observations of the
$2175 \, \mathring{\rm A}$ dust attenuation feature, well known in the Milky
Way (MW) and galaxies at $z \lesssim 3$, in the near-infrared spectra of
galaxies up to $z \sim 7$, corresponding to the first billion years of cosmic
time. The relatively short timescale implied for the formation of carbonaceous
grains giving rise to this feature suggests a rapid production process, likely
in Wolf-Rayet (WR) stars or SN ejecta.
