Wrong way to power microcontrolers (i2c project 3,3V & 5V)

In my use of the ESP32, when the ESP32 does the WiFi thing, there is a current spike that some power supplies cannot handle. I'd start with a electrolytic cap as close to the ESP as possible and a 103 ceramic cap. I, typically put the caps on the 3.3V pin.

Next, I'd look to the power supply, some are not able to do provide for the WiFI's current demand.