"Cannot Open Source File" Error

Hi all. I’m having the same problem as was discussed in this post. Specifically, within VS Code, I continually get a red squiggle underneath the #include line for the WorldPosition.generated.h file and an error that says it cannot open the source file (screenshot below).

I saw in the above linked thread that Dan said to just ignore it and it would sort itself out, but after leaving it for several days, it is still there. Ultimately, the code still compiles in Unreal without issue, so it seems to just be an intellisense error. That said, it is quite distracting to always have that error showing in my explorer sidebar, so I was hoping someone might have some kind of solution to making this go away.

Things I’ve tried aside from just waiting:
-Deleting and recreating the component
-Quitting VS Code, compiling successfully in Unreal, reopening VS Code
-Attempted to follow this post from the Unreal forums, but was unable to find the mentioned file path (perhaps because I’m on Mac and it is different)

Appreciate any help that can be offered!

Did you also try File > Refresh VS Code Project in Unreal?

5 Likes

I had not tried that yet. Seems to have worked just fine. Thanks once again for all your help, Dan!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms