Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.
I was using Qlik's version of February 2018, now I'm using November 2018.
I have a webpage to access to Qlik using javascript, it was working perfectly, but now it is generating errors and don't work. The javascript errors says:
"TypeError: window.qlikMashupLoader is not a function"
"Error: Load timeout for modules: js/qlik-require-plugin!_unnormalized2,js/qlik-require-plugin!
http://requirejs.org/docs/errors.html#timeout"
I need help to solve this bug. Thanks so much.
Hi @tony_empiredev,
Looks like you are using undocumented internal modules in your mashup; after the February release, in order to optimize performance, we removed some of the libraries that were bundeled with requirejs.
require( ["js/qlik", "xmodule"], function ( qlik, xmodule ) {...}); // this will not work anymore
// you will have to remove "xmodule"
I hope this helps
Hi Aaz,
This is a part of my code.
Html file:
{% extends 'TonyMainBundleefault:layout.html.twig' %} {% block title %}Qlik's Table for Sales{% endblock %} {% block header_title %} <div class="row"> <div class="col-md-5 col-sm-2 col-xs-10 "> Qlik's Table for Sales </div> </div> {% endblock %} {% block content %} <iframe id="iframe" style="height: 300px;width: 100%;" src=""></iframe> <button id="export" class="btn-sm btn-primary" onclick="export();">Export Data to API</button> <div id="error" style="color:red;"></div> {% endblock %} {% block others_javascripts %} <!-- First time --> <!-- <script src="{{ asset('/js/require.js') }}"></script> --> <!-- Last test --> <script src="http://mysite.com/resources/js/external/requirejs/require.js"></script> <script src="{{ asset('/js/main.js') }}"></script> {% endblock %}
And main.js file:
const HOST = 'mysite.com'; const APP_ID = 'f4d8f3a-1f96-4296-9669-38dd054kk9b5'; const SHEET_ID = 'd6b4ed73-baf3-4c20-96d0-91d72efd10aa'; const OBJECT_ID = '3f4d8785-9f35-411f-ad03-abcf090fb1b4'; var app; var config = { host: HOST, prefix: '/', port: 80, isSecure: true }; require.config( { baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port : "") + config.prefix + "resources" } ); require(['js/qlik'], function(qlik) { qlik.setOnError(function (error) { BootstrapDialog.confirm({ type: 'type-danger', message: error.message + '. Do you want reload the page ?.', callback: function (result) { if (result) { window.location.href = url_index; } } }); }); //Open the application with Id defined in APP_ID app = qlik.openApp(APP_ID, config); //Clear the filters app.clearAll(); $('#iframe').attr('src', 'http://' + HOST + '/single/?appid=' + APP_ID + '&sheet=' + SHEET_ID + '&opt=currsel&select=SalesType,1,2'); }); var export = function() { app.getObject(OBJECT_ID).then(function (model) { model.getHyperCubePivotData('/qHyperCubeDef', [{ qTop: 0, qLeft: 0, qWidth: 2, qHeight: 900 }]).then(function (cube) { //Process the cube if (cube.length > 0) { var table = getTable( cube ); console.log('Read finished'); sendToAPIREST( table ); } else { BootstrapDialog.warning('An error occurred to read the data from Qlik'); } }) }); };
As you can see, I do not use undocumented internal modules. From my website I connect with a Qlik application and a specific sheet, so I apply filters on a table and show this table in my iframe. The next action is to export data, then read from a hypercube that represents the table and send the data to an API.
Maybe you can show me a small complete example that includes connection to a Qlik application and a reading using a hypercube.
Thank you very much for your help.
Your code looks about right - I have no clue... Maybe mixing http/isSecure is the problem:
port: 80, isSecure: true