Solar panels only generate electricity when the sun is shining. To mine continuously, you'll need a reliable energy storage solution, such as batteries, to store excess energy generated during the day for use at night or during cloudy days. Wouldn't it be too expensive?
If your area has a proper grid and gives a fair deal it works.
If you use batteries it is very hard for it to work as batteries die fast. Plus they cost a lot.