Yes, exactly that's it. It seems that the esp32 development kit boards have been preflashed with an older sdk version. Thus it is necessary to erase all data in flash to get a newer app working.To clarify, are you saying that you couldn't connect to WiFi before you completely erased flash?
See https://nodemcu.readthedocs.io/en/maste ... -init-data
DetiThe SDK reserves space in flash that is used to store calibration and other data. This data changes between SDK versions, and if it is invalid or not present, the firmware may not boot correctly.