classList Error in Internet Explorer

Referring to this articel (link) I still have the “classList” error in Internet Explorer 11. And this error breaks my validations.
Can somebody tell me how I can fix that?

Edit: I’m using aurelia-cli

What does your error look like? I’ve not run into any issues with IE11 to guess it out.

Trying to translate the issue:

the property  \"classList\" of an undefined or null reference cannot be called.

That doesn’t sound like an Aurelia issue. Maybe there needs to be some example of the usage that leads to that error too

ok. I’m going to try to analyize that…
I’m wondering that in Firefox and chrome everything works fine and only in IE it breaks.

Analyzing that issue I found the point where it breaks:

Extending the model with following validation rule:

    .ensure((l: myobject) => l.item1).displayName("some-name").required()

This doesn’t work because of the required().

Exchanging the required() by e.g. matches(/\d{4}/) everything works fine:

    .ensure((l: myobject) => l.item1).displayName("some-name").matches(/\d{4}/)
1 Like

Then this would be a solved issue then. Glad you figured it out.

Not really because I do need the “required”. Currently I have no clue how I can validate required fields without using .required().

For .satisfies and .minItems I have the same behavior

Those rules are for validating your model, it should have no association with UI. I think it’s an error in your validation renderer. Can you have a check there?

1 Like

That was the issue. I have a “classList” in my validation renderer. Thank you very much for your help.

1 Like