UE 4.27 how to fix issues in visual studio code: "red squiggles" and "Unable to resolve configuration with compilerPath C:\Program"

I try to update this week a game build few months ago with 4.26 + VS code with 4.27.
And when I launch visual studio code after “refresh visual studio code project” I got these issues:

I found how to solve it .

-Root causes :

the json file compileCommands_Default.json , compileCommands_function.json and the compileCommands_xxxx in “C:\Program Files\Epic Games\UE_4.27.vscode” and in the directory of your project “D:\Documents\Unreal Projects"MyPoject”.vscode" : have an issue with all the ligns “command” because two double quotes are missing one before C:\Program and one after cl.exe, see below the current status:

“command”: “C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\HostX64\x64\cl.exe @“C:\Program Files\Epic Games\UE_4.27\.vscode\compileCommands_function\function.210.rsp””,

-Solution :
“command”: “\“C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\HostX64\x64\cl.exe\” @“C:\Program Files\Epic Games\UE_4.27\.vscode\compileCommands_function\function.210.rsp””,

After updating all the lines in the json files in “C:\Program Files\Epic Games\UE_4.27.vscode” and in your project “D:\Documents\Unreal Projects"MyPoject”.vscode" , relaunch UE and DO NOT USE “refresh visual studio code project” otherwise all your update will disappear.

And now it is ok :

11 Likes

Thank you! It was REALY helpful!

Do we need to do that every time we open or create a project?

Yes you do ! It is a bug in unreal . Windows path contains space and there are not between “…”

1 Like

You are my hero. The headache this has cause me the passed hour over something stupid as missing file_path characters.

Signed in just to press like on your post. Thank you so much!

To solve the issue a workaround is to install unreal , visual studio, … in a directory without spaces in the name :
“C:\ProgramFiles\EpicGames” instead of “C:\Program Files\Epic Games”,
“C:\ProgramFiles\MicrosoftVisualStudio” instead of "C:\Program Files\Microsoft Visual Studio