Esphome reboots HA when installing script to d1 mini

Anyone else having any problems with D1 Mini restarting HA when updates are sent wirelessly OTA to d1 mini. Attaching it directly to the Pi that holds HA stops the reboot.

Is one of the devices underpowered?
It doesn’t happen with any of my ESP devices

No all working at correct power but what I have noticed though is a reboot of ESP device and HA then allows for the flash so I wonder if it is the HA/Pi or the ESP becoming clogged up?

Interestingly the ESP that is giving the most problem displays itself in ESPhome in HA different. It shows the name of the yaml file in the box in esphome.