The energy crisis is chastening governments around the world, not least in China. Record coal prices have helped propel factory inflation there to a 26-year high and officials have had to promise that homes will be kept warm this winter come what may.

The other pledge of note from a briefing in Beijing on Wednesday is that the government won’t duck its international carbon commitments. President Xi Jinping is keen to adopt the mantle of climate leadership, so that had to be said when the crucial COP26 negotiations open in Scotland in just two weeks. But it’s difficult to square with the scramble to mine, buy and burn ever more of the dirtiest fossil fuel to keep the lights on at home.

But it isn’t an empty promise either, as shown by the sweeping ambition of the renewables mega-hub planned for western China that was also announced this week, and which in its first phase alone will host more wind and solar power than all of India.

China will have to juggle the contradictory pressures of ensuring domestic energy security and meeting its international climate obligations for some time to come. The former is clearly winning out in the short term, and comments earlier in the week from Premier Li Keqiang suggest that anyone hoping for an advancement of China’s carbon targets in Glasgow is probably going to be disappointed.

But what’s increasingly obvious—and foreshadowed by the desert mega-project—is that China’s abundant reserves of coal have created a dependency that has made the country vulnerable and which it will try and end as soon as it can. One paradox to emerge is that energy security is hardly served by a system that is actually reliant on raising imports to deliver sufficient supply.

So, once the current crisis passes, and even if China has heaps of coal to spare, the calculation will probably become ever clearer. Coal’s stranglehold on the energy mix will need to be broken. Preventing future power shortages won’t mean tapping more of those reserves, but accelerating instead the development of substitutes that aren’t dependent on foreign suppliers and won’t spoil the atmosphere.

China is likely to slash fuel exports due to the power crisis, as more gas-to-oil switching prompts refiners to hoard supplies for use at home. Domestic diesel demand is on the rise and fewer shipments would come just as other Asian nations are set to consume more of the fuel as their economies rebound.