aurelia / validatejs

Enables expressive validation using decorators and/or a fluent API.
MIT License
22 stars 23 forks source link

Cannot set property 'configurable' of undefined #84

Closed ma3yta closed 8 years ago

ma3yta commented 8 years ago

After updating aurelia-validatejs I got error undefined:1 Uncaught (in promise) Error: Cannot set property 'configurable' of undefined https://gyazo.com/a60d0c503bbad66d8e8e4050b65dfefd

its the decorator that fails when adding the rule:


 function addRule(target, key, descriptor, targetOrConfig, rule) {
    var rules = _aureliaMetadata.metadata.getOrCreateOwn(metadataKey, ValidationRules, target);
    if (targetOrConfig === null || targetOrConfig === undefined) {
      targetOrConfig = true;
    }
    rules.addRule(key, rule(targetOrConfig));

    descriptor.configurable = true;   <---------------- fails here
  }

The descriptor is undefined

ma3yta commented 8 years ago

@PWKad or @jdanyow Could you please take a look?

imressed commented 8 years ago

Have the same error...