Apologies if this is an easy or obvious fix. I'm using the latest Arduino IDE on Mac. When I create a sketch or load an example sketch, it builds and uploads fine. However, the moment I save it, they break and can no longer be build / be uploaded to my Arduino/ESP32. It will throws errors about the boot loader, not being able to find the relevant libraries or has some other issue. It seems that saving the file breaks the links to some dependencies. If I create a new sketch and copy the code over, it works fine.
Here is an example output when I just tried to build and upload a saved file.
usage: esptool [-h]
[--chip {auto,esp8266,esp32,esp32s2,esp32s3beta2,esp32s3,esp32c3,esp32c6beta,esp32h2beta1,esp32h2beta2,esp32c2}]
[--port PORT] [--baud BAUD]
[--before {default_reset,usb_reset,no_reset,no_reset_no_sync}]
[--after {hard_reset,soft_reset,no_reset,no_reset_stub}]
[--no-stub] [--trace] [--override-vddsdio [{1.8V,1.9V,OFF}]]
[--connect-attempts CONNECT_ATTEMPTS]
{load_ram,dump_mem,read_mem,write_mem,write_flash,run,image_info,make_image,elf2image,read_mac,chip_id,flash_id,read_flash_status,write_flash_status,read_flash,verify_flash,erase_flash,erase_region,merge_bin,get_security_info,version}
...
esptool: error: unrecognized arguments: KY-024 Linear Hall.ino.bootloader.bin /Users/NateSF/Library/Arduino15/packages/esp32/hardware/esp32/2.0.5/tools/sdk/esp32/bin/bootloader_dio_80m.elf
exit status 2
Compilation error: exit status 2