# Error w/ Validation Au2

**URL:** <https://discourse.aurelia.io/t/error-w-validation-au2/4791>\
**Category:** Help Requests\
**Created:** [June 1, 2022, 5:59am UTC](https://discourse.aurelia.io/t/error-w-validation-au2/4791 "2022-06-01T05:59:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArchEnemy](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/archenemy/32/2445_2.png) [@ArchEnemy](https://discourse.aurelia.io/u/ArchEnemy)\
**Post date:** [June 1, 2022, 5:59am UTC](https://discourse.aurelia.io/t/error-w-validation-au2/4791/1 "2022-06-01T05:59:46Z")

</div>

Having issues with running simple validation rule examples on a component in au2.

A very basic component form page below that is routed from a router.

```auto
import { bindable, Params, IRouter, IRouteViewModel } from 'aurelia';
import { IValidationRules } from '@aurelia/validation';
import { IValidationController } from '@aurelia/validation-html';
import { newInstanceForScope } from '@aurelia/kernel';
import template from './contact-form.html';

class Contact {
    public constructor(
       public name: string,
       public email: string,
       public message: string
    ){}
}

export class ContactForm implements IRouteViewModel {
    private contact: Contact;
    
    public constructor (
        @newInstanceForScope(IValidationController) private controller: IValidationController,
        @IValidationRules private validationRules: IValidationRules
    )
    {
        this.contact = new Contact(undefined, undefined, undefined);
       
        validationRules
          .on(this.contact)
          .ensure('name')
            .required();
    }

    public async submit(){
        //const result = await this.validationController.validate();
        //console.log(result);
    }
}

```

When you flip to the page you get the error:

```auto
Uncaught (in promise) Error: AUR0012:IPlatform
    at Container.R (index.js?8966:1047:1)
    at Container.get (index.js?8966:929:1)
    at Container.at (index.js?8966:759:1)
    at Array.map (<anonymous>)
    at Container.invoke (index.js?8966:961:1)
    at ValidationControllerFactory.construct (index.mjs?c5e3:276:1)
    at ct (index.js?8966:682:1)
    at eval (index.js?8966:673:1)
    at n.resolve (index.js?8966:613:1)
    at Container.get (index.js?8966:921:1)

```

Any ideas? I tried various constructor arguments. I followed the au2 docs to install and register “ValidationHtmlConfiguration” with defaults. Maybe I’m misunderstanding something because I’m much more used to ES/js.

---

<div class="post-metadata">

**Author:** ![Alexander-Taran](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/alexander-taran/32/2308_2.png) [@Alexander-Taran](https://discourse.aurelia.io/u/Alexander-Taran)\
**Post date:** [June 1, 2022, 5:18pm UTC](https://discourse.aurelia.io/t/error-w-validation-au2/4791/2 "2022-06-01T17:18:51Z")

</div>

![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/a/a9f3cb706b0e08f478dc0ae2a70e6c27cbb5e29a.png)

Same as  
[https://discourse.aurelia.io/t/using-interfaces-in-di-broken-in-2-0-0-alpha-30/4763/4](https://discourse.aurelia.io/t/using-interfaces-in-di-broken-in-2-0-0-alpha-30/4763/4)

update to alpha.33

---

<div class="post-metadata">

**Author:** ![Sayan751](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/sayan751/32/1861_2.png) [@Sayan751](https://discourse.aurelia.io/u/Sayan751)\
**Post date:** [June 1, 2022, 6:16pm UTC](https://discourse.aurelia.io/t/error-w-validation-au2/4791/3 "2022-06-01T18:16:10Z")

</div>

@ArchEnemy It seems to be working. Check this SB example: [au2-validation-with-router - StackBlitz](https://stackblitz.com/edit/au2-validation-with-router?file=index.html,app.ts,index.ts)

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/aurelia/original/2X/5/57c368acf77772b69e135f34fb5655de5485fade.png)

---

<div class="post-metadata">

**Author:** ![ArchEnemy](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/archenemy/32/2445_2.png) [@ArchEnemy](https://discourse.aurelia.io/u/ArchEnemy)\
**Post date:** [June 1, 2022, 7:24pm UTC](https://discourse.aurelia.io/t/error-w-validation-au2/4791/4 "2022-06-01T19:24:38Z")

</div>

Thank you so much. I didn’t realize what the issue was. Descriptive errors are so hard to interpret for some of us and the complexity of the documentation is getting to a level where “there’s many ways to do things, but which is the right way and where are the examples that don’t exactly match the one example that was done in the docs”…

Greatly appreciate the fast response. Everything is starting to work great!

---

<div class="post-metadata">

**Author:** ![ArchEnemy](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/archenemy/32/2445_2.png) [@ArchEnemy](https://discourse.aurelia.io/u/ArchEnemy)\
**Post date:** [June 1, 2022, 7:25pm UTC](https://discourse.aurelia.io/t/error-w-validation-au2/4791/5 "2022-06-01T19:25:33Z")

</div>

Thanks! I did forget to mention I was on alpha .24
