[BUG] Compiling a UMG Widget causes REINST errors on the Widgets that use it

Hello everyone,

Here’s how to repro a bug in 5 simple steps:

  • Create two Widget Blueprints called “WidgetA” and “WidgetB”:


  • Edit WidgetA and add an instance of WidgetB to its hierarchy:


  • Edit WidgetA’s graph so it references WidgetB in some way, like this:


  • Open WidgetB’s graph, add a new variable then compile:


  • WidgetA will get a REINST-related compilation error:

The error goes away if you compile WidgetA, but every time you change anything in WidgetB (graph, layout, it doesn’t matter), WidgetA will get the same error again, forcing you to recompile it manually. This can be a huge time sink if you have a “CustomButtom” widget that is used across dozens of different widgets.

BTW, I tried debugging the source code to find the reason behind the bug. I haven’t found a way to fix it, but I think I understand what causes it. As part of the compilation process, all existing instances of “Class” have their classes set to “REINST_Class” (which is the newly compiled class), then all dependent blueprints are recompiled and the REINST class is renamed to original name.

The problem with UMG widgets is that they can contain instances of other widgets in their widget tree, so when these instances have their classes switched to the REINST variant, this reflects immediately on the type of the auto-generated graph variables that point to those widgets, but the pins in the graph still point to the old non-reinst class. At some later point the pins are switched to the new class, which is why recompiling the blueprint fix things, but I haven’t located that piece of code yet (the blueprint compilation codebase is massive).

(I would be forever thankful if the commit or code changes needed to fix this were posted here. Pretty please?)

Hello manoelneto,

I was able to reproduce this issue on our end. I have written up a report ( UE-22573) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for your time and information.

Make it a great day

I’m also interested in seeing this issue fixed.

A lot of wasted time reopening the project every time a change needs to be tested

I can confirm it was fixed in 4.10. It doesn’t happens neither in my project anymore nor in the repro case. Thanks!