AUR0109
Error Message
AUR0109: Ast eval error: unknown unary operator: "<operator>"
Where <operator> is the specific operator encountered in the expression.
Description
This error occurs during the evaluation of a binding expression when the parser encounters a unary operator that it does not recognize or support.
Cause
The most common causes for this error are:
Typo in the Operator: You may have mistyped a standard unary operator (e.g., using
!!instead of!, although!!might work depending on context, it's generally not a standard single unary operator).Unsupported Operator: You might be attempting to use a unary operator that is not supported within Aurelia's binding expressions (e.g., the bitwise NOT operator
~).
Aurelia's binding language supports common JavaScript unary operators like:
!(Logical NOT)typeofvoid-(Unary Negation)+(Unary Plus - often used for numeric coercion)
Solution
Check for Typos: Carefully review the binding expression where the error occurs and correct any typos in the unary operator.
Use Supported Operators: Ensure you are only using unary operators supported by Aurelia's binding syntax. If you need functionality provided by an unsupported operator (like bitwise operations), perform that logic within your view model or via a value converter.
Example
<!-- Incorrect: Assuming '~~~' is a typo or unsupported -->
<div if.bind="~~~isActive">Content</div>
<!-- Correct: Using the supported logical NOT operator -->
<div if.bind="!isActive">Content</div>
<!-- Incorrect: Bitwise NOT (~) is not typically supported directly -->
<p>${ ~value }</p>
<!-- Correct: Perform bitwise operations in the view model or a converter -->
<p>${ value | bitwiseNot }</p>Debugging Tips
Examine the binding expression identified in the error message or stack trace.
Verify the specific unary operator being used against the list of supported operators.
Simplify the expression temporarily to isolate the problematic operator.
Consider using a value converter or view model property if complex or unsupported operations are needed within the binding.
Last updated
Was this helpful?