The carrier, at its introduction, was able to be sunk by a couple of well placed 1,000 lb bombs falling from a single engine diver. Frankly the battleship is not obsolete either with proper air, tarp, and missile defense.
Battle group effectiveness against all attack vectors determines survivability of ships.
It's not just "being vulnerable to attack". It's that an aircraft carrier can only be used against enemies with obsolete weapons. Enemies with modern weapons can sink them relatively easily.
Aircraft carriers were extremely vulnerable in WWII. They also helped win the war in the Pacific. But so did land based attack aircraft. The B-25’s armed as gunships under Gen. Kenney did a wonderful job of supporting MacArthur’s campaigns. The important lesson is that what was required was combination using land based aircraft where you could and carriers where you couldn’t.