I also encountered this error message in Visual Studio 2022 when trying to compile the standard library with the module syntax (namely import std;) turns out it was related with the /Z7 flag, and when switch to /Zi it worked just fine !