You are mixing different versions of Iron router:
Prior to the iron router 1.0, onBeforeAction will act if there is no pause (the first argument to onBeforeAction called. There is no .next() method.
Starting with version 1.0, this has been changed. pause() no longer passed as an argument. Here the .next() method replaces it.
You are obviously working on an old version of an iron router, so your hook should look like this:
function manageLoadingIndicator (pause) { if (this.ready()) { Session.set('loading', false); } else { Session.set('loading', true); pause(); } }
Once you upgrade your iron router, you need to change it to this:
function manageLoadingIndicator () { if (this.ready()) { Session.set('loading', false); this.next(); } else { Session.set('loading', true); } }
source share