AUR9991

Error Message

AUR9991: Invalid @children usage. @children decorator can only be used on a field

Description

This error occurs when the @children decorator, used for querying child elements within a component's view, is applied incorrectly. The decorator is designed only to be used on class properties (fields).

Cause

The direct cause is applying the @children decorator to something that is not a class property. Examples include:

  1. Decorating a Method: Applying @children to a method definition.

  2. Decorating a Class: Applying @children directly to the class declaration.

  3. Decorating a Getter/Setter: Applying @children to an accessor property.

Solution

Ensure that the @children decorator is only applied directly to a class property declaration.

Example

Debugging Tips

  • Review the code where the @children decorator is used.

  • Verify that the decorator is placed directly above a property declaration (e.g., items: HTMLElement[];).

  • Ensure the decorator is not applied to methods, getters, setters, or the class itself.

Last updated

Was this helpful?