Getting "isn't a valid subclass" errors"

Seems to be recorded under UE-17866. Is there any progress on this?

When starting my project, one UMG blueprint complains about a class not being a subclass of another, so a node that takes a class input pin and a cast node both report an error. Pressing compile works. However, when I go to build it, cooking fails because of this issue. I’ve tried reparenting, recompile all classes, nothing fixes it.

Is there a way to ignore this in cooking or to fix this issue? At this point I can’t package the game.

Finally found a temporary workaround! Adding a ‘cast to class’ node, and selecting the same class as the input pin works, although it seems like it should return exactly the same thing. i.e:

Change:

76769-capture.png

to this:

76770-capture2.png

Not sure why this works at all - it seems to be casting the class to itself. I don’t think its the fact that its inline either - I tested changing the function to an impure function previously because i thought it was generating the function calls in a way that was out of sync with class generation, but that didnt work.

Either way, nice to have a workaround.

Wow! What a timing: You just saved my life :smiley:

Very useful fix - thanks!
My guess is that it works because the explicit cast tells the cooker that it needs to compile the class to which you’re casting before it can compile this one. I’m guessing that it doesn’t spot this otherwise, and can fail depending on your cook order. Interestingly, I was dealing with one of these just now that cooked fine on Mac and PS4, but failed on Win64 and Win32, which is what suggests to me that it arises as an accident of the cooking order.

That could be it! I’ve also run into similar cooker issues where adding a variable to a struct causes cooker errors on each blueprint that uses it. To resolve that I had to change a variable name in the blueprint, recompile, change it back, recompile again and save. The cooker then ran through perfectly.