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