Carriers are increasingly vulnerable against things like missiles and drones that are multiple orders of magnitude cheaper. Think about how a carrier group would defend itself against, say, a heterogenous attack of 100-200 combined simultaneous ballistic missiles, cruise missiles, drones, and/or manned aircraft.
Obviously carrier groups have multiple layers of missile defense: CWIS, combat air patrols, etc. But you only need one missile to get through and that carrier is quite possibly going to be unable to launch planes for quite a while.
And even if you don't hit the carrier, the carrier is going to be undertaking evasive maneuvers during the attack. That means no planes taking off and landing. For a very early example of this, look at the Battle of Midway. The American air attacks were disorganized and sporadic. And yet, they largely kept the Japanese carriers from flying planes for much of the day, leading to a crushing American victory just as their window of opportunity closed.
None of this exactly means carriers are "obsolete." Against non-peers, that is still a whole lotta force projection.