Yep. An EMP renders them useless
Actually, EMP is amazingly easy to shield against. The US military has been shielding most of their equipment against it for over five decades now.
Here you go, this is how sophisticated the technology has to be to protect equipment from EMP:
The Faraday Cage is actually very old technology. As in, the actual concepts for how it works were first published way back in 1754, making it older than the US itself. And Benjamin Franklin experimented with them. But at that time it was just a curiosity, something they could observe but because of technology levels had no useful function. But after the EMP effect from atomic blasts was discovered, the military quickly started to place them in their equipment. Then by the 1950s they started to be used for other purposes, like counter-espionage.
In the 1980s and early 1990s we had entire series of computers that had EMP shielding built into them. It was called TEMPEST, and was designed to keep "information" from leaking out of a computer. But the exact same technology works both ways, and it also prevented things from leaking into a computer. I actually used some of those beasts in the late 1980s and early 1990s.
Meet the AN/UYK-83. I actually used to have one of those beasts on my desk from 1988-1993. The thing was an absolute beast, the main computer must have weighed almost 100 pounds. The monitor was another 100 pounds, the keyboard was around 10 pounds. All of that casing you see is thick steel, and all the doors and openings are protected with overlapping metal that functioned like a Faraday Cage. The entire computer came in three large shipping containers, and weighed something like 250 pounds.
And when I was deployed, I had a similar computer that was a "laptop". That is, if you consider it did not have a battery and had to be plugged into the wall to work. And weighed around 50 pounds. But it was portable, so easy to take with me when I went overseas.
Not the same thing I had, but actually fairly close.
But the problem is that for anything like that to work, you need humans to maintain them. If you have a "squad" of 10 "robots" functioning on the battlefield, then there are likely going to be about 150-200 men required to maintain them regularly within a short distance away. To fix them when something breaks, and to provide them with whatever fuel they will need to function. You can send out a squad of humans with a case of MREs and they can operate for days. And if they are there longer, just send them more MREs. You ain't gonna do that with machines.