Qlik在Visual Studio插件中给出websocket错误和define()错误
问题描述:
我开始使用qlik桌面,并且已通过Visual Studio插件连接到桌面。我已经添加了2张到Visual Studio,但是当我调试到localhost,我得到的错误Qlik在Visual Studio插件中给出websocket错误和define()错误
在.js文件...
var config = {
host: window.location.hostname,
prefix: '/',
port: window.location.port,
isSecure: window.location.protocol === "https:"
};
require.config({
baseUrl: (config.isSecure ? "https://" : "http://") + config.host + (config.port ? ":" + config.port : "") + config.prefix + "resources"
});
require(["js/qlik"], function(qlik) {
// open the app
var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d', config);
//someone please tell me what this id is and where it comes from
because I c&p'd off of the tutorials and idk what goes here
});
在VS:
<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="server">
<div class="qlik-embed" data-qlik-appid="\\apfs01\users\rbeets\Documents\Qlik\Sense\Apps\app1.qvf" data-qlik-objid="ZCJjkN></div>
<div class="qlik-embed" data-qlik-appid="\\apfs01\users\rbeets\Documents\Qlik\Sense\Apps\app2.qvf" data-qlik-objid="JRcLVC"></div>
</asp:Content>
和错误1和2:
Websocket connection to 'ws://localhost......aspx' failed. Error during Websocket handshake. Unexpected response code: 404
Uncaught Error: Mismatched anonymous define() module ...from require.js:6 1 View Tags : localhostContent tagged with localhost, visual studio pluginContent tagged with visual studio plugin, websocketContent tagged with websocket, mismatched anonymous define()Content tagged with mismatched anonymous define()
答
我在下面的链接找到了答案,它给出了通过任一方法找到appId的方法服务器或桌面(本地主机)连接....
您是否正在学习教程?我的猜测是你在openApp()中的id是来自Sense Server的QS appID。你有一台运行的服务器还是只有QS客户端?如果您使用客户端,则应输入应用程序的名称而不是ID。 – mickeger
是的,我正在学习一个教程(只是为了桌面atm),我发现了正确的appID,没有更多的websocket错误!谢谢。现在到其他错误大声笑 – Rainhider