Carriers will became obsolete when the concept of air superiority over huge swaths of ocean become obsolete. Which means never.
The key to having superiority at sea is the industrial infrastructure to produce new ships and to repair damaged ones quickly.
Chinese industrial base is ascendant and ours is in rapid decline. So they win.
If China went to a war footing they could crank those babies out by the dozen. They have a huge steel production capability, and the man power to do it.
It isn't so important the navy you have at the beginning of a naval conflict it's the navy you have at the end that's important.
Carriers are sitting ducks if you have weapons in low Earth orbit.
Another key is having an economy that doesn’t collapse on occasion. If they have a Recession, those ships get really expensive to operate.