TypeError: Cannot read property ‘visitStatement’ of undefined

Quick tip: When working in Angular 2 if you get an error that looks like:

EXCEPTION: TypeError: Cannot read property ‘visitStatement’ of undefined

Or:

EXCEPTION: Error: Uncaught (in promise): TypeError: Cannot read property ‘visitStatement’ of undefined

Try checking your code for an empty ‘click’ event binding (<component (click)=""></component>). If the event is left empty it can throw that relatively nondescript error.

 

8 thoughts on “TypeError: Cannot read property ‘visitStatement’ of undefined”

Leave a Reply

Your email address will not be published.