Many countries in Europe have substantially increased their share of carbon-free electricity over the past decades. However, the dramatic 2021-2022 increase in European natural gas prices and electricity prices has raised concerns about the vulnerability of electricity markets. Here, we develop a country-specific metric of vulnerability and find that countries that pursued more aggressive electricity decarbonization are not more vulnerable to natural gas price shocks. However, countries with a higher share of intermittent renewable generation are slightly more vulnerable, potentially due to the complementarity of these technologies with natural gas generation. We show that heterogeneity in vulnerability implies country-specific policies are required to avoid unintended climate consequences of extreme electricity prices, in contrast to the existing uniform EU price cap. Our results emphasize that decarbonization goals can still be achieved without risking vulnerability.