# AUR4102

## Error Message

```
AUR4102: Unable to parse accessor function:
<function source>
```

## Description

This error occurs when the validation serializer/deserializer tries to parse an accessor function (for example `(x) => x.someProp`) but cannot extract a supported property access from it.

## Common Scenarios

```ts
import { ValidationRules } from '@aurelia/validation';

// ❌ Unsupported accessor shape for serialization
ValidationRules
  .ensure((x: any) => x[getDynamicKey()])
  .required()
  .on(class Model {});
```

## Solution

* Use a simple property accessor that the validation system can interpret.

```ts
import { ValidationRules } from '@aurelia/validation';

class Model {
  public name = '';
}

// ✅ Simple accessor
ValidationRules
  .ensure((x: Model) => x.name)
  .required()
  .on(Model);
```

## Troubleshooting

* Keep accessors to direct property access (`x => x.prop`) when you intend to serialize rules.
* If you need dynamic behavior, avoid serialization or build rules at runtime instead of hydrating from serialized data.


---

# 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/4100-to-4106/aur4102.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.
