If the $X(3872)$ is a weakly bound charm-meson molecule, it can be produced in $e^+ e^-$ annihilation by the creation of $D^{*0} bar D^{*0}$ from a virtual photon followed by the rescattering of the P-wave charm-meson pair into the $X$ and a photon. A triangle singularity produces a narrow peak in the cross section for $e^+ e^- to X gamma$ 2.2 MeV above the $D^{*0} bar{D}^{*0}$ threshold. We predict the normalized cross section in the region of the peak. We show that the absorptive contribution to the cross section for $e^+ e^- to D^{*0} bar D^{*0} to X gamma$, which was calculated previously by Dubynskiy and Voloshin, does not give a good approximation to the peak from the triangle singularity.