For example solar energy and uranium seems to be projected to grow a lot in the future. Would it make sense to find index funds that track solar energy companies or uranium mining companies and invest in such ETFs?
If you believe either that sector X has growth potential, or you believe that your interest in Sector X allows you to pick winners within that sector, then it can make sense invest in that sector.
When people talk about diversification, that can mean that some of your investments are concentrated in a sector. You shouldn't have all your money in one sector, but it wouldn't be unusual to have 10-20% in a single sector.
One example is when people suggest that you should have some money in real estate.
It is not unusual to see people have some of their 401(k) money, or company shares owned through a employee only purchase plan. It would be dangerous to have all your retirement funds in you company, but 5-10% wouldn't be unusual.