Missing Compile Button / Hot Reload not working

Hello guys!
I am was working on my code today, when I realized that not only my code changes do not get hot-reloaded into the editor anymore, but also my Compile Button is missing:

Some time, it was there, this project started as BP only but I am using C++ since many many months.

What I’ve already tried:

  • I have rebuilt the solution multiple times
  • Deactivated my plugins
  • Cooked the Project (only some ‘known’ warnings, no errors)
  • Deleted the .vs, Binaries, Build, Saved and Intermediate folders as well as the solution, Generated Visual Studio project files, rebuilt, cooked…
  • Created a new cpp actor class
  • Refreshed Visual Studio Project in the editor

The only other thing I could imagine causing this was updating to a newer Visual Studio 2017 version which caused me some compile trouble which I managed to resolve.

Has anyone some Ideas or what could be wrong/experiences with that problem?

This is how my .uproject looks like:

{
	"FileVersion": 3,
	"EngineAssociation": "4.24",
	"Category": "",
	"Description": "",
	"Modules": [
		{
			"Name": "HarrisonProject",
			"Type": "Runtime",
			"LoadingPhase": "Default",
			"AdditionalDependencies": [
				"CoreUObject",
				"AIModule",
				"Engine",
				"GameplayAbilities"
			]
		}
	],
	"Plugins": [
		{
			"Name": "DlgSystem",
			"Enabled": true,
			"MarketplaceURL": "com.epicgames.launcher://ue/marketplace/content/6d0255a60be340dfa1c556503cc57eb3"
		},
		{
			"Name": "GameplayAbilities",
			"Enabled": true
		},
		{
			"Name": "VictoryBPLibrary",
			"Enabled": true,
			"MarketplaceURL": "http://www.ue4code.com"
		},
		{
			"Name": "LowEntryExtStdLib",
			"Enabled": true,
			"MarketplaceURL": "com.epicgames.launcher://ue/marketplace/content/846c2ad08f164f45b0335ecebf85361e"
		}
	]
}

As you can see, the Modules Section is not only there, but also well filled… Do you have other ideas what could be the problem?

302172-ah-ss.png

Right click your uproject file and open it with notepad or any text editor. Make sure your project has the “module” section. If it isn’t there, add it like in the image above with your project name and save. You should see the compile button now along with hot-reloads.

I had the same issue that you described in the post and got it fixed by adding the module part (which was missing in my case after upgrading from VS2017 to VS2019). Unfortunately I don’t have any more clues to what might be the cause.

Ok, I have an idea what could be the problem.

I’ve modified my Project.h & .cpp files because I wanted to add a virtual shader source path, so I could use .usf files in my custom material nodes. Therefore I worked on my Project Module.
As I am not very experienced in working with modules in ue4, I’ve followed this forum post for the implementation: LINK

Here are the files, can you spot something suspicious in there? I’ve also tried to add my “HarrisonProject” Module to the HarrisonProject.uproject, but this changed nothing.

HarrisonProject.h:

// Copyright by Felix Voigt

#pragma once

#include "CoreMinimal.h"
#include "ModuleManager.h"

//Project Module to add virtual shader files
//https://forums.unrealengine.com/development-discussion/rendering/1562454-virtual-shader-source-path-link-custom-shaders-shadertoy-demo-download
class FHarrisonProjectModule : public IModuleInterface
{
public:
	virtual void StartupModule() override;
	virtual void ShutdownModule() override;
};

HarrisonProject.cpp:

// Copyright by Felix Voigt

#include "HarrisonProject.h"
#include "Modules/ModuleManager.h"
#include "Interfaces/IPluginManager.h"
#include "Logging/LogMacros.h"
#include "Misc/Paths.h"
#include "Shader.h"

#define LOCTEXT_NAMESPACE "FHarrisonProjectModule"

void FHarrisonProjectModule::StartupModule()
{
#if (ENGINE_MINOR_VERSION >= 21)    
    FString ShaderDirectory = FPaths::Combine(FPaths::ProjectDir(), TEXT("Shaders"));
    AddShaderSourceDirectoryMapping("/Project", ShaderDirectory);
#endif
}

void FHarrisonProjectModule::ShutdownModule()
{
	//necessary?
	ResetAllShaderSourceDirectoryMappings();
}

IMPLEMENT_PRIMARY_GAME_MODULE(FHarrisonProjectModule, HarrisonProject, "HarrisonProject" );

For whatever reason I could not coment your answer, so I’ve written a new answer …

I’ve found the solution: The module has to derive from FDefaultGameModuleImpl instead of IModuleInterface. So HarrisonProject.h should look like that:

class FHarrisonProjectModule : public FDefaultGameModuleImpl

instead of

class FHarrisonProjectModule : public IModuleInterface

Thanks for your help!

1 Like