ESPHome crashes HA on flashing - cannot reach node either

I found that my RPi3b+ could not handle ESPhome properly until I increased the swap file size.