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 call method '$new' of undefined in loader.js

  • I am creating a small app with a sliding menu and a navigator, however it is not working properly: it shows me the message in the title whenever I try to push a page with the navigator after having set a new main stage through the sliding menu. For example:

    I open my App and push a new page and then pop it. Everything ok.

    BUT if I open my app and set a new main stage through the sliding menu and then push a new page it shows “Cannot call method ‘$new’ of undefined in loader.js (…)”.

    What does this mean? I know the controller of the pushed page doesn’t get executed because the alert() I set up never shows. (however if i put an alert onclick of the button that gets to the page it does show up)

    Edit: the sliding menu always sets the main stage to the same page but sends different options

  • Well, I did not understand why but I found the problem. I can’t have a sliding-menu with a main-page being a navigator. I had this:

    <ons-template id="mainpage.html">
           <ons-navigator var="main.nav" page="html/users/login.html" animation="slide">

    But this does not work and gives that error. If I set the sliding menu to a external page and only called in html/users/login.html the error won’t show.

    I just thought I would give my solution if anyone else gets this