Getting an error when trying to access componentPropertyDefinition of a main component

I’m getting the following error when trying to access propertyDefinitions of a main component.

I’m accessing this main component from an instance node by getMainComponentAsync, awaiting its promise.

In the documentation it says that componentPropertyDefinitions property is available for ComponentNode and ComponentSetNode.

But when I try to access it I get the following error:

in get_componentPropertyDefinitions: Can only get component property definitions of a component set or non-variant component

Isn’t a MainComponent a non-variant component?
If not, how do I access either a ComponentSet from an InstanceNode or its non-variant component version? I just need to check for variant options of a property to catch errors when matching it against data provided by the user…

The mainComponent is a reference to ComponentNode. Also note:

That is, a Variant is also a ComponentNode.

Just check the parent of the main component.

And use the async method you mentioned instead of the deprecated mainComponent property from that example.

1 Like

This worked! Thank you so much