This only makes sense way downstream of massive subsidies, not the least of which is China determining at a federal level that they wanted to produce an obscene amount of solar panels.

And now it's complicated because the ideal move would just be to say "thank you" and buy all the cheap panels and batteries, but that hollows out your own industry.