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.

Error in loader.js: line 503



  • I am getting the following error.

    Class not found(anonymous function) @ loader.js:503
    

    Did some tracing and the error is Onsen’s www/components/loader.js.

      // Get device id
      document.addEventListener("deviceready", function() {
    
        cordova.exec(function(result) {
            monaca.cloud.deviceId = new String(result.deviceId);
            monaca.cloud.url = new String(result.url);
            monaca.cloud.backendId = new String(result.backendId);
            monaca.cloud.apiKey = new String(result.apiKey);
    
            // execute and clear postQueue
            for (var i = 0; i < monaca.cloud.postQueue.length; i++) {
              monaca.cloud._doPost.apply(monaca.cloud, monaca.cloud.postQueue[i]);
            }
            monaca.cloud.postQueue = [];
          }, function(error) {
            console.error(error); // <--- ERROR HERE
          },
    
          "Monaca",
          "getRuntimeConfiguration", []
        );
    
      }, false);
    

    Not sure what this does. Should this be a concern?

    It looks like it is trying to authenticate to Monaca Cloud with a device ID, backend ID and API key for a registered Monaca Cloud user.


  • Monaca

    Where did you get the error? From debug panel? Debugger’s app log?
    Were you using Monaca Backend? Can you show the snippet of your code using Monaca backend?



  • @khemry I am not using Monaca Cloud at all. Nor have I registered any user account. I am just including Onsen UI in my project, so I don’t know why it is trying to contact Monaca Cloud ondeviceready.

    Perhaps I manually edited <project_dir>\.monaca\project_info.json directory and it thinks I am using Monaca Cloud?


  • Monaca

    @wetfeet Hmmm… Can you show the content of project_info.json here?



  • @khemry

    {
        "plugins": [
            "mobi.monaca.plugins.Monaca"
        ],
        "framework_version": "3.5",
        "xcode_version": "7",
        "cordova_version": "6.2",
        "plugin_settings": [],
        "external_plugins": [
            "cordova-plugin-console@1.0.7",
            "cordova-plugin-whitelist@1.2.2",
            "cordova-plugin-splashscreen@3.2.2",
            "cordova-custom-config@2.0.3"
        ]
    }
    

    Anyway, this morning I totally replaced my Onsen UI (2.2.4 that came with the project template?) with the latest 2.4.2 and the error seems to have gone away.

    Before that, I was patching the old Onsen UI 2.2.4 with .js and .css files one-by-one from unpkg.com CDN. And then it might have become sort of broken anyway.


  • Monaca

    @wetfeet There is nothing wrong with the snippet. We are glad your issue is solved. Maybe it was because of the patching but the error was kinda weird and unrelated. We will keep this in mind. Thanks for reporting.