# AUR0723

### **Error message**

Template compilation error: Invalid comma-separated class binding syntax in {{0}}. It resulted in no valid class names after parsing.

### **Parameters**

1. `target`: The invalid comma-separated string provided as the target for the `.class` binding command.

### Error explanation

This error occurs when using the `.class` binding command with a comma-separated list of class names as the target, but the list is invalid or results in no actual class names after processing. This typically happens if the string contains only commas or whitespace between commas.

The `.class` binding command allows specifying multiple static classes along with the dynamic binding, like `my-class,another-class.class="expression"`. The part before `.class` is split by commas, and each part should be a valid class name.

### Common causes

* Providing only commas or whitespace as the target for `.class` (e.g., `, .class="expr"`).
* Having trailing or leading commas without valid class names in between (e.g., `my-class,.class="expr"`).

### How to fix

* Ensure that if you use a comma-separated list for the `.class` binding target, it contains valid class names separated by commas.
* Remove unnecessary commas or whitespace.
* If you only intend to bind dynamically without static classes, use `class.bind="expression"` instead of `.class="expression"`.

### Example of Incorrect Usage:

```html
<!-- Error: Only a comma before .class -->
<div ,.class="isActive ? 'active' : ''"></div>

<!-- Error: Comma with whitespace before .class -->
<div  ,  .class="isActive ? 'active' : ''"></div>

<!-- Error: Trailing comma -->
<div my-static-class,.class="isActive ? 'active' : ''"></div>
```

### Example of Correct Usage:

```html
<!-- Binding dynamic class only -->
<div class.bind="isActive ? 'active' : ''"></div>

<!-- Binding dynamic class with one static class -->
<div my-static-class.class="isActive ? 'active' : ''"></div>

<!-- Binding dynamic class with multiple static classes -->
<div my-static-class,another-one.class="isActive ? 'active' : ''"></div>
```


---

# 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/aur0723.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.
