I can figure out what is wrong with this simple sketch

Ok I assumed all Variables were global by default.
my esp32 seemed to upload the code and was working fine a few hours ago but now it just hangs saying this:-

Wrote 292768 bytes (157662 compressed) at 0x00010000 in 2.8 seconds (effective 825.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
type or paste code here