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

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.

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.

Last updated

Was this helpful?