Evey things cease to function

I was working on my project and everything compiles well but suddenly the code not working anymore and produces numerous errors, at the first I thought I made the coding mistake but I have noticed even fresh empty code such as a following is not working anymore

#include <Arduino.h>
void setup() {
  // put your setup code here, to run once:
}
void loop() {
  // put your main code here, to run repeatedly:
}

these are errors that come up from compiling the above code

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.5.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 3.10006.210326 (1.0.6)
 - tool-esptoolpy 1.30100.210531 (3.1.0)
 - toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 28 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\esp32dev\src\main.cpp.o
Generating partitions .pio\build\esp32dev\partitions.bin
Archiving .pio\build\esp32dev\libFrameworkArduinoVariant.a
Compiling .pio\build\esp32dev\FrameworkArduino\Esp.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\FunctionalInterrupt.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\IPv6Address.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\MD5Builder.cpp.o
Compiling .pio\build\esp32dev\FrameworkArduino\Print.cpp.o
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\HardwareSerial.cpp:7:0:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\HardwareSerial.h:54:1: error: expected class-name before '{' token
 {
 ^
*** [.pio\build\esp32dev\FrameworkArduino\HardwareSerial.cpp.o] Error 1
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:151:0,
                 from src\main.cpp:1:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Client.h:27:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:153:0,
                 from src\main.cpp:1:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Udp.h:42:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:154:0,
                 from src\main.cpp:1:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/HardwareSerial.h:54:1: error: expected class-name before '{' token
 {
 ^
*** [.pio\build\esp32dev\src\main.cpp.o] Error 1
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Arduino.h:151:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Esp.cpp:20:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Client.h:27:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Arduino.h:153:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Esp.cpp:20:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Udp.h:42:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Arduino.h:154:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Esp.cpp:20:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\HardwareSerial.h:54:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Arduino.h:151:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\FunctionalInterrupt.cpp:9:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Client.h:27:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Arduino.h:153:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\FunctionalInterrupt.cpp:9:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Udp.h:42:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Arduino.h:154:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\FunctionalInterrupt.cpp:9:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\HardwareSerial.h:54:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:151:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\IPAddress.cpp:20:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Client.h:27:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:153:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\IPAddress.cpp:20:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Udp.h:42:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:154:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\IPAddress.cpp:20:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/HardwareSerial.h:54:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:151:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\IPv6Address.cpp:20:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Client.h:27:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:153:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\IPv6Address.cpp:20:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Udp.h:42:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:154:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\IPv6Address.cpp:20:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/HardwareSerial.h:54:1: error: expected class-name before '{' token
 {
 ^
*** [.pio\build\esp32dev\FrameworkArduino\FunctionalInterrupt.cpp.o] Error 1
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:151:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\MD5Builder.cpp:19:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Client.h:27:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:153:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\MD5Builder.cpp:19:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Udp.h:42:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:154:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\MD5Builder.cpp:19:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/HardwareSerial.h:54:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\MD5Builder.cpp:20:0:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/MD5Builder.h:55:20: error: 'Stream' has not been declared
     bool addStream(Stream & stream, const size_t maxLen);
                    ^
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\MD5Builder.cpp:56:28: error: 'bool MD5Builder::addStream' is not a static data member of 'class MD5Builder'
 bool MD5Builder::addStream(Stream & stream, const size_t maxLen)
                            ^
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\MD5Builder.cpp:56:28: error: 'Stream' was not declared in this scope
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\MD5Builder.cpp:56:37: error: 'stream' was not declared in this scope
 bool MD5Builder::addStream(Stream & stream, const size_t maxLen)
                                     ^
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\MD5Builder.cpp:56:45: error: expected primary-expression before 'const'
 bool MD5Builder::addStream(Stream & stream, const size_t maxLen)
                                             ^
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\MD5Builder.cpp:56:64: error: expression list treated as compound expression in initializer [-fpermissive]
 bool MD5Builder::addStream(Stream & stream, const size_t maxLen)
                                                                ^
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\MD5Builder.cpp:57:1: error: expected ',' or ';' before '{' token
 {
 ^
*** [.pio\build\esp32dev\FrameworkArduino\IPAddress.cpp.o] Error 1
*** [.pio\build\esp32dev\FrameworkArduino\IPv6Address.cpp.o] Error 1
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Arduino.h:151:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Print.cpp:28:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Client.h:27:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Arduino.h:153:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Print.cpp:28:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Udp.h:42:1: error: expected class-name before '{' token
 {
 ^
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Arduino.h:154:0,
                 from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Print.cpp:28:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\HardwareSerial.h:54:1: error: expected class-name before '{' token
 {
 ^
*** [.pio\build\esp32dev\FrameworkArduino\MD5Builder.cpp.o] Error 1
In file included from C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32\Esp.cpp:33:0:
C:\Users\Hamid\.platformio\packages\framework-arduinoespressif32\cores\esp32/MD5Builder.h:55:20: error: 'Stream' has not been declared
     bool addStream(Stream & stream, const size_t maxLen);
                    ^
*** [.pio\build\esp32dev\FrameworkArduino\Print.cpp.o] Error 1
*** [.pio\build\esp32dev\FrameworkArduino\Esp.cpp.o] Error 1
==================================================================== [FAILED] Took 3.29 seconds ====================================================================
The terminal process "C:\Users\Hamid\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

Please see Error : showing up on every project - #2 by maxgerhardt.