After I had some problems to compile WLED by myself, I found the error. I wanted to compile wled with the ESP32 and it came constantly the following error “fatal error: soc/gpio_reg.h: No such file or directory”. When i compiled for the ESP8266 everything was ok.
After a longer search I found the error. The error is actually easy to find, if you read the log carefully, but well. It was because of the framework archive which PIO put on the computer (C:\Users<USER>.platformio\packages). there was beside the “framework-arduinoespressif32” another one and this was accessed by PIO. After I deleted both, I could compile without problems.
Maybe this would be another info to add to the FAQ in the compilation issues section.
I guess this topic will also have had the same error PlatformIO IDE 2.5.1 - breaks custom compile for esp8266