AUR0157
Error Message
AUR0157: Expression error: invalid empty expression. Empty expression is only valid in event bindings (trigger, delegate, capture etc...)
Description
This error occurs when an empty binding expression is used in contexts where it's not allowed. Empty expressions are only valid for event bindings where they can be used to prevent default behavior.
Common Scenarios
<!-- ❌ Wrong: Empty expressions in property bindings -->
<div textcontent.bind=""></div>
<input value.bind="">
<!-- ✅ Correct: Empty expressions in event bindings -->
<form submit.trigger=""><!-- Prevents default form submission -->
<a href="#" click.trigger=""><!-- Prevents navigation -->
Solution
<!-- ✅ Correct: Provide actual expressions -->
<div textcontent.bind="message || 'Default text'"></div>
<input value.bind="inputValue">
<!-- ✅ Correct: Event bindings can be empty -->
<form submit.trigger="handleSubmit()">
<a href="#" click.trigger="handleClick()">
Last updated
Was this helpful?