VS + Cordova + WP8 = requirejs模块的加载超时 [英] VS + Cordova + WP8 = requirejs load timeout for modules

查看:212
本文介绍了VS + Cordova + WP8 = requirejs模块的加载超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2015 + Cordova构建一个Windows手机游戏。
当尝试在设备上调试时,会收到此错误:

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



第8行第137列的未处理异常ms-appx-web://net.boardgamesonline.drawit/www/js/libs/require.js
0x800a139e - JavaScript运行时错误:模块加载超时:
sounds,libs / signals.min, config,components / share ....

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....

我的VS运行在Windows 10上,并更新了所有内容(cordova,sdks,tools .. )
同样的项目是为Android和iOS使用英特尔XDK和工程。
但是在VS它不工作在Windows Phone 10调试时。

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.

这是我的index.html:

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) {


推荐答案

通过在Visual Studio中重新创建Cordova项目来解决。
新建项目+复制文件。

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

这篇关于VS + Cordova + WP8 = requirejs模块的加载超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆