# AUR0765

## Error Message

`AUR0765: Trying to retrieve a custom element controller from a node. But the provided node <{{nodeName}} /> does not appear to be part of an Aurelia app DOM tree, or it was added to the DOM in a way that Aurelia cannot properly resolve its position in the component tree.`

Where `{{nodeName}}` is the tag name of the provided DOM node.

## Description

This error has the same root cause as [AUR0764](https://docs.aurelia.io/developer-guides/error-messages/runtime-html/aur0764): Aurelia cannot resolve a controller relationship for the provided node within the current app’s component tree.

## Example Trigger

```ts
import { CustomElement } from '@aurelia/runtime-html';

// ❌ Node is detached or outside the Aurelia app root
const node = document.querySelector('#outside-the-app')!;
CustomElement.findController(node); // throws AUR0765
```

## Correct Usage

See [AUR0764](https://docs.aurelia.io/developer-guides/error-messages/runtime-html/aur0764) for guidance on ensuring nodes are Aurelia-managed before attempting controller lookup.

## Related Errors

* [AUR0764](https://docs.aurelia.io/developer-guides/error-messages/runtime-html/aur0764)
* [AUR0762](https://docs.aurelia.io/developer-guides/error-messages/runtime-html/aur0762)
* [AUR0763](https://docs.aurelia.io/developer-guides/error-messages/runtime-html/aur0763)
