Hot reload fails: "This is likely a stale module that must be recompiled."

I’m not sure when this started, but in my code project hot reload fails every time now with message “… (API version -1), but it was incompatible with the current engine API version (0). This is likely a stale module that must be recompiled.”

I tried to rebuild the whole solution but the problem still persists. This is on 4.5.1. Any idea what’s causing this?

Hi Gigantoad,

Is this only occurring in your own project, or do you see the same message in a new project? Are you using the binary version of the Engine, or did you build the Engine using source code? Is this message appearing in Visual Studio or in the Editor?

Hi

Just tried in a different project with same editor and get the same issue. It’s 4.51 built from source. Message appears in the editor Output Log after compiling in Visual Studio for hot reload.

Using the Compile button inside the editor seems to work though.

Do you get the same results if you try to build the project in Visual Studio with the Editor closed (not performing a Hot Reload)? What template did you use when you created a new project for your test, and what steps did you follow until you saw the Hot Reload fail?

The message appears in the Output Log in the editor, so with it closed I don’t get it of course. That’s essentially like restarting the editor. Also noticed that after that message appeared, the compile button inside the editor stops working.

Used the Top Down C++ template to test. As for steps, nothing special. After initial compilation opened the editor, added some code in C++, compiled in VS and get the failed message in the editor.

I just tried with the binary version of 4.51 that I got through the launcher, and to my surprise I get the same problem there.

Just tried the same thing in 4.6 preview and it works fine. So, I guess, wait for 4.6 final which will arrive soon? Still wouldn’t hurt to know what the problem is in case that ever comes up again.

I am still having trouble reproducing this issue. I created a new project using the C++ Top Down template in 4.5.1 using an Engine built from source code. I performed a couple hot reloads. The first one was just adding a couple UPROPERTY variables to the included character class, and the second was adding a few lines of code to the PlayerController class. This is what was shown in the Output Log in the Editor afterwards:

It is possible this has been corrected in 4.6, but I can’t say for sure without being able to reproduce it.

Safe to say it must be something specific on my end. After investigating some more I think it may have to do with a plugin. Just strange it only happened after a while in 4.51. I’ll see if I can find out more

Did you install the visual studio update that was pushed out recently? I saw this issue the other day after updating. When starting the editor from Visual Studio, Unreal Build Tool didn’t see any need to recompile as all the objs and source were unmodified, but when hot reloading obviously it forces a compilation again, and the differences between compiler versions introduced by the update seems to trigger this message too.
I ended up doing a full rebuild of the engine and that resolved the issue. I know you mentioned you tried this in the binary build of the editor and still got the error, but I figured I’d record this here for posterity as another potential cause.

I do have that update, however hot reload also used to work with it. But yeah who knows what’s going on.

Right, so from what you’re saying we can confirm that the update itself isn’t the trigger for the issue in your case; it was, in mine.

Could you open your project and trigger the message, then immediately close the Editor and retrieve the project and Engine logs for that period and upload those here?

link text

Engine didn’t log anything in that moment, unless I looked in the wrong place (Engine/Saved/Logs?).

Oh ****, same thing happens in 4.6 now.

Hi Gigantoad, does it also happen when you hot-reload from the editor? Have you tried re-building the project in VS when the editor is closed to see if the problem goes away then?

No, if I use Compile in the editor it works fine. Yes neither completely rebuilding project nor the editor fixed the issue.

Ok, thanks. Can you link the output from Visual Studio after recompiling the module?

You mean this?

========== Build: 2 succeeded or up-to-date, 0 failed, 37 skipped, Completed at 09.12.2014 17:24:01 ==========

Not much going on there, looks as ever.

Ok, this is strange, I’d expect it to actually compile something! How do you compile it inside of VS? The supported path is:

  1. Right click on the game target you want to recompile code for
  2. Click ‘Build’

I’m not sure what you mean, or maybe I just posted the wrong thing (last line of the output just because everything seems normal)? It does compile, I just change something in the game project and then build as you descibed. Then hot reload fails in the editor, after restarting the editor the change is there so it compiled alright.