Notice: The Monaca & Onsen UI Community Forum is shutting down.

For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.

Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.

Cannot read property 'removeEventListener' of null - Error explantation.



  • I was getting two errors:

    1. "Cannot read property ‘removeEventListener’ of null "

    2. and then “pushPage is already running” (broke navigation).

    With some digging I found sort of an obscure post that mentioned “setTimeout”: https://community.onsen.io/topic/3303/uncaught-in-promise-pushpage-is-already-running/2

    I gave it a go and inserted a setTimeout to my function and everything works now. See below:

    function editItem(getName, getDetails) {
      document.querySelector('#myNavigator').pushPage('page4.html').then(setTimeout (function(){
        var noteName = document.getElementById('note-name');
        var noteDetails = document.getElementById('note-details');
        noteName.innerHTML = getName;
        noteDetails.innerHTML = getDetails;
      }), 5000);
    }
    

    Now it seems to work better. However, after a couple of clicks I get the errors again. Can anybody lead me in the right direction so I can research this better. Thanks.