That is strange. My 5.1 project gives exacly same error. Do you find any solution?
Edit: I solved my problem.
- Open Visual Studio Code and update(go Help>Check for updates)
- Than open UE and make ‘Force Update Device’ for Windows Platform
- Restart UE
Done.