The paper presents a study of the influence of nanovoids formed in the metal surface layer on the field emission current (the first stage of the accelerator structure breakdown). It is shown that the field emission current through nanovoids has a resonant character. It was found that under resonant conditions, an increase in the current density from the copper surface by more than 3.5 times compared to the case of an unmodified surface is observed. The presence of a dielectric in the nanovoids expands the resonant region. When the resonance conditions are not met or the diameter of the nanovoids increases, the current density decreases to zero, which can be a way to prevent an accelerator structure breakdown.