I'm building an application using Angular 5. The application works perfectly in chrome, firefox and even safari. But I'm getting all sorts of errors in IE 11. The initial problem was the page rendering but that was resolved by uncommenting the lines of code in polyfills.ts. But then I got stuck with a couple of issues that have been keeping me for hours.

  1. TypeError: Object doesn't support property or method 'matches'
  2. TypeError: Unable to get property 'matches' of undefined or null reference

I managed to resolve the first one by adding the following lines in polyfills.ts,

if (!Element.prototype.matches) {
    Element.prototype.matches = Element.prototype.msMatchesSelector;

But I'm unable to resolve the second one. Any suggestions?

  • 2
    what is Element? – Daniel A. White Jun 20 '18 at 19:07
  • 2
    We need to see the code that is throwing the error really... it looks like the value you're trying to call matches on is null or undefined. – user184994 Jun 20 '18 at 19:09
  • 1
  • 1
    I'm getting this error when I'm routing to other routes – wolfsbane Jun 20 '18 at 19:13
  • I was using a dynamic form and there were issues with the submit button in the form. Also, there were issues in functions like includes that are not recognized by IE. So, by resolving those issues, I found that the error mentioned in the question can be ignored as it was not affecting the overall functionality of the application. – wolfsbane Jun 21 '18 at 11:13

Your Answer


Browse other questions tagged or ask your own question.