Whenever I load index.html, I see this error



  • Hi,
    Whenever I load index.html, I keep getting this error.

    loader.js:1 Uncaught TypeError: Cannot read property ‘split’ of undefined
    at loader.js:1
    at loader.js:1

    How to fix it please?

    Thanks



  • @mmike,

    Are we supposed to know what is in your index.html file?

    You want help, read this: https://community.onsen.io/topic/188/how-to-ask-a-question



  • Fran,

    Index.html was created from monaca. I get this error from loader.js.

    <html>
    <head>
    <meta charset=“utf-8”>
    <meta name=“viewport” content=“width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no”>
    <meta http-equiv=“Content-Security-Policy” content=“default-src * data: gap: https://ssl.gstatic.com; style-src * ‘unsafe-inline’; script-src * ‘unsafe-inline’ ‘unsafe-eval’”>
    <script src=“components/loader.js”></script>
    <script src=“lib/onsenui/js/onsenui.min.js”></script>
    <link rel=“stylesheet” href=“components/loader.css”>
    <link rel=“stylesheet” href=“lib/onsenui/css/onsenui.css”>

    Any thoughts?

    Thanks for your help!



  • Fran, Could you respond please?

    Thanks!



  • @mmike,

    PMFJI, the following is an index.html generated by Monaca based on the Onsen UI V2 JS Minimum template (v2.6.1)and runs fine on desktop browser and mobile device! What happens if you generate a new project as in this sample? Compare the loader.js files in the two versions?

    <!DOCTYPE HTML>
    <html>
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
      <meta http-equiv="Content-Security-Policy" content="default-src * data: gap: https://ssl.gstatic.com; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">
      <script src="components/loader.js"></script>
      <script src="lib/onsenui/js/onsenui.min.js"></script>
        
      <link rel="stylesheet" href="components/loader.css">
      <link rel="stylesheet" href="lib/onsenui/css/onsenui.css">
      <link rel="stylesheet" href="lib/onsenui/css/onsen-css-components.css">
      <link rel="stylesheet" href="css/style.css">
    
      <script>
        ons.ready(function() {
          console.log("Onsen UI is ready!");
        });
      </script>
    </head>
    <body>
      This is a template for Onsen UI app.
    </body>
    </html>
    

Log in to reply