【问题标题】:Uncaught ReferenceError: WL is not defined in MobileFirst Migrated app未捕获的 ReferenceError:未在 MobileFirst Migrated 应用程序中定义 WL
【发布时间】:2016-07-22 16:55:58
【问题描述】:

我正在将 MFP 应用程序从 V7.1 迁移到 V8.0。我运行了迁移工具,它创建了 cordova 项目,然后我将代码从 MFP V7.1 项目的 common 目录迁移到了新创建的 cordova 项目的 www 目录。我进行了this 页面中提到的更改。我在服务器上注册了我的应用程序,然后做了mfpdev app pullmfpdev app push 然后进行了cordova 准备,然后我使用“mfpdev 应用程序预览”运行了应用程序预览。当应用程序在浏览器上打开时,我收到以下错误:

http://localhost:10081/android/assets/www/worklight/worklight.css Failed to load resource: the server responded with a status of 404 (Not Found)
AuthRealmChallangeProcesser.js:7 Uncaught ReferenceError: WL is not defined
jquery-2.1.1.js:8554 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
browser-sync-client.2.11.1.js:129 Uncaught TypeError: Cannot read property 'data1469206076574' of null
http://localhost:10081/android/assets/www/cordova.js Failed to load resource: the server responded with a status of 404 (Not Found)_mbs_cordova_sim_load_js @ cordova.js:2198
cordova.js:1186 Channel not fired: onPluginsReady
cordova.js:1186 Channel not fired: onCordovaReady

以下是脚本标签中 index.html 文件中引用的文件:

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="worklight/worklight.css">
    <link rel="stylesheet" href="css/main.css">
    <script type="text/javascript" src="cordova.js"></script>
    <script src="jqueryMobile/jquery-2.1.1.js"></script>
    <script src="https://maps.googleapis.com/maps/api/js?key=mykey"></script>
    <title>My App</title>
    <script src="jqueryMobile/jquery.mobile-1.4.2.js"></script>
    <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
    <link rel="stylesheet" href="css/themes/jBlue/jBlue.css" />
    <link rel="stylesheet" href="css/themes/jBlue/jquery.mobile.icons.min.css">
    <link rel="stylesheet" href="jqueryMobile/jquery.mobile.structure-1.4.2.css" />
    <!-- Uncomment Below for default theme and change data-theme to "a"-->
    <link rel="stylesheet" href="jqueryMobile/jquery.mobile-1.4.2.css" />
    <script src="js/AuthRealmChallangeProcesser.js"></script>

【问题讨论】:

    标签: ibm-mobilefirst mobilefirst-server


    【解决方案1】:

    我在服务器上注册了我的应用,然后做了 mfpdev app pull 和 mfpdev app push

    如果您在服务器上有现有配置并且您想要获取(拉取)并在其他地方使用(推送),您只需要使用mfpdev app pull/push。它与将 Hybrid 应用程序迁移到 Cordova 应用程序无关。

    http://localhost:10081/android/assets/www/worklight/worklight.css资源加载失败:服务器响应状态为404(未找到)

    从错误看来,您指的是一个不存在的文件。仔细检查它是否确实存在。

    http://localhost:10081/android/assets/www/cordova.js资源加载失败:服务器响应状态为404(未找到)_mbs_cordova_sim_load_js@cordova.js:2198

    您是否也复制了此文件?你不应该。您应该只在 index.html 文件中引用它。 Cordova 会处理这个问题。

    您也没有说明您是否遵循了其他剩余步骤,例如步骤 3.2。这里提到:https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/migration-cookbook/#migrating-applications

    【讨论】:

      猜你喜欢
      • 2015-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-08
      • 2021-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多