I see, so the case is like fake error right? it successfully compiled from the editor, but its fail in the VS?
I don’t know the specific solution through this problem, however, you can try to delete your Intermediate and .sln files, after then you can regenerate visual studio project file by right clicking the .uproject and select Generate VS project file. Although I don’t know if that will fix the problem or not (but If i meet a fake error, I usually do this).