After successfully building and deploying several ESPHome apps, I’ve come across a problem with an app that was working OK but now will not complete the build - and brings the Raspberry Pi to its knees. I simply tried to add the web server/api to the app and now it stalls at the “Compiling /data/hallway_lights/.pioenvs/hallway_lights/lib4d9/ESP8266WiFi/ESP8266WiFi.cpp.o” step.
The other thing you might want to try is to delete (or move) the build folder and build from scratch. The build folder is named the same as the YAML file and is in the same directory.