Using a widget with a property binding in another widget causes compile error.

  1. Create a new widget called WidgetA
  2. Add a Text widget to WidgetA
  3. Select the Text widget, click the Bind dropdown, select Create Binding
  4. Compile and save WidgetA
  5. Create another new widget called WidgetB
  6. Add an instance of WidgetA to WidgetB
  7. Compile WidgetB

Gives the compile error:
“Unable To Create Template For Widget.
Fast CreateWidget Warning! This class can not be created using the fast path, because the property SourceObject on PropertyBinding references WidgetA. Please add the ‘Instanced’ flag to this property.”

It doesn’t seem to matter what kind of property binding you use. I tried it with an Image widget instead of the Text widget, binding the brush and had the same result.

I took a look at the code, and the error looks like it comes from UUserWidget::VerifyTemplateIntegrity. If the UObjectProperty has the flag CPF_Transient or CPF_InstancedReference, it doesn’t throw the error. If I mark the Text widget as a variable, it shows that it has the CPF_InstancedReference flag. Same for the WidgetA instance. The editor won’t let me set either of them as Transient. Debugging it, it seems like it is the UTextBinding itself triggering the error anyway, rather than any of the widgets.

Is there some way around this?

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://epicsupport.force.com/unrealengine/s/

Thanks

Reported it through the new bug reporting method and got a response:

“This can be resolved by opening the graph tab, selecting class settings, and at the bottom enabling “Force Slow Construction””

To clarify, in my example, you would turn this option on for WidgetB. I had tried enabling it on WidgetA, but apparently forgot to try it on WidgetB. I’m dumb.

The original error message is… somewhat misleading, I think :stuck_out_tongue: