Files keep missing during build

Trying to build ESP32 code. The platformio gives different error everytime I build. Tried everything to fix. Deleted .platformio folder, performed clean build. I searched online for solution but didn’t find any. I have attached screenshots of the different error I got each time I build. BTW I have used platformio for 6 to 7 months now, this is the first time I encountered an issue.

Errors during each build of the same project.

Screenshot 2023-06-22 005342
Screenshot 2023-06-22 005408

Do you have Win32 long paths enabled? See here.

Thanks for your response. When I tried to enable the long path through regedit, it was already enabled.

Can you upload a minimal project that reproduces the error?

After installing C/C++ Extension pack the issue seems to be gone for now. I tried to build the project several times and it built successfully. Thanks for taking time to reply. I will reopen the issue if it happens again. Have a good day.

It’s happening again, the projects not building.