uncaught exception: pushPage is already running.



  • Hi,

    I’m constantly getting this error:

    uncaught exception: pushPage is already running.
    

    I have been trying to figure this out and find the source of it for over 5 hours and I can’t and I’m pulling my hair out!

    I’m simply using this code to change pages:

    document.querySelector('#myNavigator').pushPage('individual.html',{animation:'slide'});
    

    Could someone please advice on this issue?


  • Onsen UI

    @David-Hope that exception is thrown if the navigator is still trying to execute some previous action when you push. What you provided is not enough to figure out why that’s happening in your specific case. Can you show us some more of your code? Or maybe try to reproduce the issue in the tutorial app.



  • @misterjunio I just figured it out.

    When I use inline onclick events to navigate to another page using pushPage, everyhting works fine but when I use a global click event that error pops up again.

    That is very strange.

    Any particular reason for it?


  • Onsen UI

    @David-Hope My guess would be more than one element is triggering click, so you have more than one “simultaneous” call to pushPage and hence the error.


  • Onsen UI

    @David-Hope What do you mean with a “global” click event? Perhaps you are setting that event more than once.



  • @David-Hope Are you selecting the element by class name ? If so, it might be similar to my problem where the DOM elements of previously pushed pages are still present but only hidden.

    https://community.onsen.io/topic/1377/javascript-stops-working-after-pushing-works-again-when-resetting-navigator/7

    If you’re using jQuery, try doing $('.yourClass:last').on... and see if the problems persists.



  • @Fran-Diox I create a click function for the class name.

    example:

    $('.className).on... 
    

    @4dnan Yeah, using the class name… i thought about using your suggestion lastnight but I totally forgot about it lol… Clever idea that is…


Log in to reply