# AUR0704

### **Error message**

Template compilation error: Invalid command "{{0:.command}}" for `<let>`. Only to-view/bind supported.

### **Parameters**

1. `command`: The invalid binding command used (e.g., `one-time`, `two-way`, `trigger`).

### Error explanation

This error occurs when the template compiler finds an unsupported binding command on an attribute of a `<let>` element. The `<let>` element is designed for creating variables within a template scope, and it only supports `.bind` (for simple assignment or expression evaluation) or no command (which defaults to `.to-view` / one-way binding). Other commands like `.one-time`, `.two-way`, `.trigger`, `.capture`, etc., are not applicable to `<let>` elements.

### Common causes

* Using `.one-time`, `.from-view`, `.two-way`, `.trigger`, or `.capture` on an attribute of a `<let>` element.

### How to fix

* Remove the unsupported binding command from the `<let>` element's attribute.
* Use `.bind` if you need to evaluate an expression.
* Use no binding command for simple one-way binding (`.to-view`).

### Example of Incorrect Usage:

```html
<!-- Error: .two-way is not supported on <let> -->
<let my-var.two-way="someValue"></let>

<!-- Error: .trigger is not supported on <let> -->
<let click-handler.trigger="doSomething()"></let>

<!-- Error: .one-time is not supported on <let> -->
<let config.one-time="initialConfig"></let>
```

### Example of Correct Usage:

```html
<!-- Using .bind (or default .to-view) -->
<let my-var.bind="someExpression"></let>
<let another-var="someStaticValue"></let>
<let user-name.bind="user.profile.name"></let>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aurelia.io/developer-guides/error-messages/0088-to-0723/aur0704.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
