Everything will degrade overtime, and solar panels are no exception. A good quality and well-maintained solar panel can last around 40 years with good output, and most manufacturers will offer a warranty of 25 years.
Solar panels are delicate systems that are designed to be installed in a safe location. The only semi-safe place for us is on the roof. Even then, that raises the challenge of cleaning them regularly. Also, it might get hit by lightning (this is how my mind works 😉 ) and consequently be destroyed. Of all these solar panel hazards, the most important thing to remember is to avoid a broken seal in the protective coating. Broken seals allow water to seep into the panel and ultimately shorten the lifespan of the panel.
Aside from cost factors, I’d like to see solar panels become less delicate and more durable.