Error 'viewHistory.currentView is undefined' on navigation

Hello everyone,

I’m getting an error and I’m not sure whether I’m doing anything wrong or whether there might be a bug in Ionic. So I’d be grateful for any feedback. The error is ‘viewHistory.currentView is undefined’, and it also results in a page not being updated properly.
I’ve managed to distill it down to a fairly small example which I’ve put on codepen:

Steps to reproduce:
(Enable console in codepen to see the error)
a) Click on the button to go to the ‘About’ page (this calls a function in the controller which uses $state.go('about');.
b) From the ‘About’ page, open the side menu and click on ‘Starting page’.

  1. Back on the Starting page, open the side menu again and go to the ‘My Account’ page.

  2. From the ‘My Account’ page, use either the button or the side menu to go back to the Starting page.

You will see the error come up in the console, and the title bar will not be updated. (And in my work-in-progress, any dynamic data in the Starting page will not be updated either. I think the Enter events are not called for the page.)

In my actual work-in-progress app, I first noticed the error when I introduced the $state.go navigation from inside a function which is called when you click the button on the starting page. In the codepen example, the button only takes you to the ‘About’ page, but in my work-in-progress, I’m using the $state.go navigation together with an ID parameter when you click on a list item and are taken to a detail view (that’s why I introduced the $state.go).
So, to me it seems that the way in which side menu navigation and $state.go navigation are combined, does not work correctly in my case. Of course, as I said above, it’s perfectly possible that I’m doing something wrong. :slight_smile:

Thanks in advance,