  The dark photon ($A'$) production through the mixing with the bremsstrahlung
photon from the electron scattering off nuclei can be accompanied by the
dominant invisible $A'$ decay into dark-sector particles. In this work we
discuss the missing energy signature of this process in the experiment NA64
aiming at the search for $A'\to invisible$ decays with a high-energy electron
beam at the CERN SPS. We show the distinctive distributions of variables that
can be used to distinguish the $A'\to invisible$ signal from background. The
results of the detailed simulation of the detector response for the events with
and without $A'$ emission are presented. The efficiency of the signal event
selection is estimated. It is used to evaluate the sensitivity of the
experiment and show that it allows to probe the still unexplored area of the
mixing strength $10^{-6}\lesssim \epsilon \lesssim 10^{-2}$ and masses up to
$M_{A'} \lesssim 1$ GeV. The results obtained are compared with the results
from other calculations. In the case of the signal observation, a possibility
of extraction of the parameters $M_{A'}$ and $\epsilon$ by using the missing
energy spectrum shape is discussed. We consider as an example the $A'$ with the
mass 16.7 MeV and mixing $\epsilon \lesssim 10^{-3}$, which can explain an
excess of events recently observed in nuclear transitions of an excited state
of $^8$Be. We show that if such $A'$ exists its invisible decay can be observed
in NA64 within a month of running, while data accumulated during a few months
would allow also to determine the $\epsilon$ and $M_{A'}$ parameters.
