Most of Europe doesn't have the will to defend themselves even in invasion, either:
https://brilliantmaps.com/europe-fight-war/
But that's how it is since the end of WWII. Major nations, or at least wealthy ones, don't go to open war with each other anymore. American hegemony and the NATO alliance structure, as well as the nuclear umbrella, has sapped the will to fight from most of the developed world, outside of brushfire conflicts. Taiwan is not a major nation, but it was an economic power, and at least has very comfortable first world living conditions. In such a situation, why would the population want to throw it all away?
Though on the other hand, why would the PRC, with its burgeoning middle classes and its coastal opulence, want to do something as destabilizing as to declare war, unprovoked? At the very least they'd face sanctions and diplomatic disapproval. The military build-up is concerning and should be taken seriously. But those who would assume that China would just cavalierly declare war in the near future should consider how much China would lose in the bargain.