This is usually because the signal is weak.
Also, the battery may be too weak to type. Try moving the keyboard closer to the USB adapter and change to new fresh batteries.
The spacebar might be loose / broken. The warranty should still be valid for one year by the manufacturer. Contact Logitech for a replacement and they should be willing to send you a replacement since it's still in the 1 year period.