Find the solution in this thread link
ESP32 boards don’t work with ESP8266WiFi.h, you have to use Wifi.h instead.