Being exciting and being a career that is a credible field of employment are two very different things. People are discouraged about the latter, for extremely rational, metric-based reasons.
A lot of computer science is going to continue to happen, but I suspect by an increasingly smaller and smaller number of people.
Going into a field just for a career is a bad choice anyway, if it works out you will be tangled with something you don't care about for years, so you lose either way.
I bet this is one of the big reasons for mental health issues in modern society, doing something that is not as lucrative but gives you sense of satisfaction and purpose works much better in the long term.