aurelia / validatejs

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

Returning to viewmodel with using the fluent API causes an exception #35

Closed drdwilcox closed 8 years ago

drdwilcox commented 8 years ago

In the sample, if I move from Fluent -> Decorators and back again, I get an exception:

Inner Error:
Message: Validator cannot handle multiple objects
Inner Error Stack:
Error: Validator cannot handle multiple objects
    at Validator.ensure (http://localhost:3000/jspm_packages/npm/aurelia-validatejs@0.2.1/validator.js:36:15)
    at new Fluent (http://localhost:3000/dist/fluent.js:22:34)
    at Object.invoke (http://localhost:3000/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:329:14)
    at InvocationHandler.invoke (http://localhost:3000/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:300:168)
    at Container.invoke (http://localhost:3000/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:564:25)
    at StrategyResolver.get (http://localhost:3000/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:127:37)
    at Container.get (http://localhost:3000/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:501:23)
    at eval (http://localhost:3000/jspm_packages/npm/aurelia-templating@1.0.0-beta.1.2.5/aurelia-templating.js:3925:73)
End Inner Error Stack
------------------------------------------------

    at Validator.ensure (http://localhost:3000/jspm_packages/npm/aurelia-validatejs@0.2.1/validator.js:36:15)
    at new Fluent (http://localhost:3000/dist/fluent.js:22:34)
    at Object.invoke (http://localhost:3000/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:329:14)
    at InvocationHandler.invoke (http://localhost:3000/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:300:168)
    at Container.invoke (http://localhost:3000/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:564:25)
    at StrategyResolver.get (http://localhost:3000/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:127:37)
    at Container.get (http://localhost:3000/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:501:23)
    at eval (http://localhost:3000/jspm_packages/npm/aurelia-templating@1.0.0-beta.1.2.5/aurelia-templating.js:3925:73)
End Inner Error Stack
------------------------------------------------

    at new AggregateError (http://localhost:3000/jspm_packages/npm/aurelia-pal@1.0.0-beta.1.2.1/aurelia-pal.js:38:13)
    at Container.invoke (http://localhost:3000/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:566:15)
    at StrategyResolver.get (http://localhost:3000/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:127:37)
    at Container.get (http://localhost:3000/jspm_packages/npm/aurelia-dependency-injection@1.0.0-beta.1.2.2/aurelia-dependency-injection.js:501:23)
    at eval (http://localhost:3000/jspm_packages/npm/aurelia-templating@1.0.0-beta.1.2.5/aurelia-templating.js:3925:73)

I see the same error in my own application when using the fluent API.

apawsey commented 8 years ago

Apparently to be 'resolved' in release on Tuesday (from comments in #40)

plwalters commented 8 years ago

This should be resolved please reopen if not.

apawsey commented 8 years ago

to be released on tuesday next week?

plwalters commented 8 years ago

This should have been resolved in yesterdays release. I'll double-check now if you are still seein gthis.

apawsey commented 8 years ago

I actually haven't updated in my app yet, so don't worry, I just thought as you were posting now after the release, that it had missed the previous cutoff. If there is a problem, I'll shout but thanks!!