I have found that the Sparkfun ESP32 Arduino library has several shortcomings and has caused me different compiler errors. Instead, I use the standard ESP32 library by Expressif Systems installed with the IDE- boards manager. The latest version is 2.0.14. Just select the ‘Sparkfun ESP32 MicroMod’ and it all works.