  In some short gamma-ray bursts, precursor flares occurring $\sim$ seconds
prior to the main episode have been observed. These flares may then be
associated with the last few cycles of the inspiral when the orbital frequency
is a few hundred Hz. During these final cycles, tidal forces can resonantly
excite quasi-normal modes in the inspiralling stars, leading to a rapid
increase in their amplitude. It has been shown that these modes can exert
sufficiently strong strains onto the neutron star crust to instigate yieldings.
Due to the typical frequencies of $g$-modes being $\sim 100\text{ Hz}$, their
resonances with the orbital frequency match the precursor timings and warrant
further investigation. Adopting realistic equations of state and solving the
general-relativistic pulsation equations, we study $g$-mode resonances in
coalescing quasi-circular binaries, where we consider various stellar rotation
rates, degrees of stratification, and magnetic field structures. We show that
for some combination of stellar parameters, the resonantly excited $g_1$- and
$g_2$-modes may lead to crustal failure and trigger precursor flares.
