SlotAsCanvasSlot returns nullptr [Ambigious search]

I’m getting errors and warnings (also from UE4) with this:

The output log is full of warnings (getting spammed by it left and right). This is the only topic that I could find about it but it doesn’t provide a solution: Ambiguous search, could be CanvasPanel /Game/sb.sb:WidgetTree.CanvasPanel_0 - UI - Unreal Engine Forums

A snippet of the warning-spam:

LogUObjectHash: Warning: Ambiguous search, could be CanvasPanel /Game/UI/BP_Inventory.BP_Inventory:WidgetTree.CanvasPanel_0 or CanvasPanel /Engine/Transient.World_11:BP_PrioRow_C_6.WidgetTree_327.pbtn_Construct.WidgetTree_333.CanvasPanel_0
LogUObjectHash: Warning: Ambiguous search, could be CanvasPanel /Game/UI/BP_Inventory.BP_Inventory:WidgetTree.CanvasPanel_0 or CanvasPanel /Engine/Transient.World_11:BP_PrioRow_C_6.WidgetTree_327.pbtn_ChopWood.WidgetTree_332.CanvasPanel_0
etc. etc.

It seems that I get those warnings for every single UserWidget Blueprint that I have.

For some odd reason I often only find the answer shortly after posting… Anyway in this particular case the warnings&errors were removed by changing this invalid value to something ‘valid’. Looks like an UE4 bug. Also I expected UE4 to inform me about this bad enum-value instead of throwing really odd warnings&Errors and a stack-trace that I can’t possibly follow.

223727-asnwer.png

Another thing to note is that whenever UE4 sets your enum to that ‘MAX-value’, the actual value is always 1 too large. So if your enum has 4 values (ranging from 0 to 3), it’s value will be 4 and thus the enum value also won’t even exist. I don’t understand this mechanic from UE4. So not only does it (silently) sometimes set your enums to another value without warning you, it also defaults to an invalid value that does not exist, guaranteed to cause horrible bugs that take many hours or even days to figure out.

I still get a nullptr back from the SlotAsCanvasSlot node but I solved it by setting the position through a VerticalBox and then just setting the position of that VerticalBox instead of setting the position of that UserWidget directly… Yeah I know it’s a dirty workaround but until someone knows how to fix that, it’s the best I can do.

P.S.

Also these AnswerHub Errors…

An Internal error has occurred and we
are sorry for the inconvenience. We
are doing our best to fix the problem
as soon as possible.

^ Been seeing such errors for years. Always ctrl+c the post before posting on AnswerHub just in case.