Using ConstructorHelper for creating widgets freezes the editor at 72% loading

I am facing a weird issue. Here is a portion of my code. I have debugged and confirmed this is the part that is causing the problem. Removing it works fine.

Basically i am using


ConstructorHelpers

for getting User Widget Blueprint. But for some unknown reason, in some cases it works in some cases the editor simply freezes at 72% loading. I decided to check if


GEngine

is valid or not, which make it work perfectly fine no issues or errors. It works in editor, standalone.

The problem however occurs when i package the game. Packaging went smoothly no issues, errors in output window. But the game simply crashes. Throws this issue:

F8Kke4o.png

Here is the answerhub question:
https://answers.unrealengine.com/questions/670306/ssertion-failed-recursionnotallowedincrement-1.html

Is it a bug? or am i doing something wrong?

Also i know i can use


TSubClassOf<>

3vx4edI.png
and then select the widget from the dropdown in the detail panel. Which works but the biggest drawback is whenever i make some changes to the class i need to re-select the class from the dropdown AGAIN! Instead i hard coded the referance paths and using


ConstructorHelpers

for that purpose.

I had a similar problem with Widgets hanging but i could not find any solution to it. So I just moved it out of the constructor and now everything works fine.
Putting it in property like you did last is the way I solve most of the preselection of assets.

Yeah i also moved everything out of constructor and it works fine. Seems like a bug. I posted on answerhub but no response :frowning:

Epic confirms this as a bug. Here is the bug report in case anyone is facing the same issue:

If you have 291 warnings, it’s time to clean up your house, as one might say.

It’s hard to debug things without a log. Can you copy the last few lines of the log when it crashes?