For anyone still looking for this. You need to add PrivateDepencencyModuleNames in your project’s .Build.cs.
if (Target.bBuildEditor)
{
PrivateDependencyModuleNames.AddRange(
new string[] {
"LevelEditor",
"UnrealEd",
});
}