某些客户端无法在生产环境中加载Google API,但我无法找到我的代码有任何问题。RequireJS异步! Google客户端API的插件 - 加载超时?
下面是我得到了什么:Load async resource with requirejs timeout
显示错误消息是:
Uncaught Error: Load timeout for modules: async! https://apis.google.com/js/client.js!onload_unnormalized2,async!https://apis.google.com/js/client.js!onload http://requirejs.org/docs/errors.html#timeout
此代码不
// Load Google's JavaScript Client API using requireJS !async plugin.
// You can learn more about the async plugin here: https://github.com/millermedeiros/requirejs-plugins/blob/master/src/async.js
define([
'async!https://apis.google.com/js/client.js!onload'
], function() {
'use strict';
console.log("googleAPI has loaded", window.gapi, window.gapi.client);
return window.gapi;
});
我从拉此信息在本地为我提供任何问题。它加载得很好。
第一步我把调试问题在requireConfig从7增加waitMinutes到90我想,也许很多人都连接速度非常慢:
define(function() {
require.config({
baseUrl: 'js/',
enforceDefine: true,
// I'm seeing load timeouts on in googleAPI -- seeing if increasing wait time helps.
waitSeconds: 90,
...
});
});
这似乎并没有影响到这个问题。我仍然看到许多客户报告问题。
在这种情况下可以使用其他哪些调试选项?谢谢