LoRa: Initializarion problem that follows the code and not the hardware

The 'LoRaSender' example form the library you are using does work on an ESP32.

When posting code please use the quotes, it makes code a lot easier to read, details found here;

I dont see a LoRa.setPins() command, thats normally needed to tell the library which pins on the ESP32 you have the LoRa module connected too.