Are you sure about that? https://en.wikipedia.org/wiki/Nuclear_electromagnetic_pulse
https://jsis.washington.edu/news/chinas-high-altitude-electr...
I believe the US already tracks (or attempts to track) anything resembling a missile headed our way, and there are systems that can take these down before they detonate and cause problems. You can't exactly "stop" a solar flare from hitting Earth. Additionally, we can also use diplomacy to create the conditions where China (or anyone else) won't want to EMP us (or at least won't benefit from doing it, even if they do want to), but we can't do that with the Sun.
And that's where my point on prioritization comes into play. We're more likely to invest in technology like Israel's Iron Dome to prevent an EMP from another nation than we would a full scale re-build of the grid to mitigate what amounts to an act of God from the sun.
Of course, the harm to their own systems would be substantial as well given that it would have a huge impact on satellites in orbit, not just systems on the ground.