> For the complete documentation index, see [llms.txt](https://docs.aurelia.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aurelia.io/developer-guides/error-messages/0088-to-0723/aur0706.md).

# AUR0706

Template compilation error: detected projection with \[au-slot="yyyy"] attempted on a non custom element zzzz.

### **Error message**

Template compilation error: detected projection with `[au-slot="{{0}}"]` attempted on a non custom element {{1}}.

### **Parameters**

1. `slotName`: The value of the `au-slot` attribute.
2. `elementName`: The name of the element where the `au-slot` was found.

### Error explanation

This error occurs when the template compiler encounters an `au-slot` attribute on an element that is being used *within* a template that does not belong to a custom element. The `au-slot` attribute is used to specify which named slot within a *custom element* the content should be projected into. It has no meaning when used inside a regular HTML element's template or a template that is not associated with a custom element definition.

### Common causes

* Adding `au-slot="some-slot"` to an element inside a template that is not the template for a custom element.
* Trying to use slot projection logic outside the context of a parent custom element.

### How to fix

* Ensure that the `au-slot` attribute is only used on elements that are direct children (or nested within children) of a custom element usage.
* The parent element where the content containing `au-slot` is placed must be a custom element that defines `<slot>` elements in its own template.

### Example of Incorrect Usage:

```html
<!-- plain-template.html (Not a custom element template) -->
<template>
  <div>
    <!-- Error: Cannot use au-slot here because the parent template is not a custom element -->
    <span au-slot="header">This won't work</span>
  </div>
</template>
```

### Example of Correct Usage:

```html
<!-- my-card.html (Custom Element Template) -->
<template>
  <div class="card">
    <div class="card-header">
      <slot name="header">Default Header</slot> <!-- Slot defined -->
    </div>
    <div class="card-body">
      <slot>Default Body</slot> <!-- Default slot defined -->
    </div>
  </div>
</template>

<!-- usage.html -->
<template>
  <require from="./my-card"></require>

  <my-card>
    <!-- Correct: Projecting into the 'header' slot of my-card -->
    <span au-slot="header">Card Title</span>

    <!-- Correct: Projecting into the default slot of my-card -->
    <p>This is the card body content.</p>
  </my-card>
</template>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
