VS + Cordova + WP8 = requirejs load timeout for modules
Asked Answered
V

1

3

I am building a windows phone mobile game using Visual Studio 2015 + Cordova. When trying to debug on device I get this error:

Unhandled exception at line 8, column 137 in ms-appx-web://net.boardgamesonline.drawit/www/js/libs/require.js 0x800a139e - JavaScript runtime error: Load timeout for modules: sounds,libs/signals.min,config,components/share....

My VS runs on Windows 10 and has everything updated (cordova, sdks, tools..) The same project was built for Android and iOS using Intel XDK and works. But on VS it doesn't work on Windows Phone 10 when debugging. If I release it - it works, but I need the debugger working.

Here is my index.html:

<!DOCTYPE html>
<html>
<head>
    <title>DrawIt</title>    
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
  <link rel="stylesheet" type="text/css" href="style.css">
  <link rel="stylesheet" type="text/css" href="debug.css">
  <script>
    var ua = navigator.userAgent.toLowerCase();
    window.isAndroid    = ua.indexOf('android') > -1;
    window.isIOS        = ua.indexOf('ipod') > -1 || ua.indexOf('ipad') > -1 || ua.indexOf('iphone') > -1;
    window.isCordova    = document.URL.indexOf( 'http://' ) === -1 && document.URL.indexOf( 'https://' ) === -1;
    window.isWEB        = false;
    window.isFacebook   = document.location.search.substr(1) === 'facebook-view';

    if (window.isCordova) {
      document.write('<scr'+'ipt type="text/javascript" src="cordova.js"></scr'+'ipt>');
    }

  </script>
  <script type="text/javascript" src="js/youtube.js"></script>
</head>

<body>
  <div id="gameContainer"></div>
  <!--<script type="text/javascript" src="cordova.js"></script>-->
  <script type="text/javascript" src="js/libs/polyfill.min.js"></script>
  <script type="text/javascript" src="js/libs/soundjs-0.6.2.min.js"></script>
  <script type="text/javascript" src="js/libs/TweenMax.min.js"></script>
  <script type="text/javascript" src="js/libs/jquery-1.12.0.min.js"></script>
  <script type="text/javascript" src="js/libs/socket.io-1.4.5.js"></script>
  <script type="text/javascript" data-main="js/main" src="js/libs/require.js"></script>
  <div id="player"></div> <!-- video player for rules view -->
</body>
</html>

Update: Here is the initialization code:

requirejs.config({

});

require([
    'assets', 
    'game',
    'lobby',
    'utils/stage',
    'utils/fontFaceImport',
    'components/popup',
    'libs/pixi.min',
    'sounds'
], function(AssetsReady, Game, Lobby, Stage, FontLoader, Popup, PIXI, Sounds) {
Virtuous answered 12/4, 2016 at 10:12 Comment(4)
The errors starts from "require.js". Please Check if the modules are defined correctly in your "main.js" file. See "LOAD TIMEOUT FOR MODULES" section of Common Errors of RequireJS.Permanent
I saw it. It says it is either error in the modules (not the case), or paths problem. I tried putting the require in different places, staring with slash, removing modules..etc..same error pops again and againVirtuous
Would you please post the code that sets up your app with the require config function?Erythrism
I added it. The config is empty. I tried waitSeconds: 0 and some other values but that is not the problem.Virtuous
V
0

The problem was solved by recreating the Cordova project in Visual Studio. New Project + copying the files.

Virtuous answered 14/4, 2016 at 20:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.