Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
tony_empiredev
Contributor II
Contributor II

Website don't work after change Qlik version

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.

Labels (4)
7 Replies
Aiham_Azmeh
Employee
Employee

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

tony_empiredev
Contributor II
Contributor II
Author

Hi Aaz,

This is a part of my code.

Html file:

{% extends 'TonyMainBundle:Default: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.

Aiham_Azmeh
Employee
Employee

Your code looks about right - I have no clue... Maybe mixing http/isSecure is the problem:

port: 80,
isSecure: true
petermicuch
Contributor II
Contributor II

I do not think it is mixing http/isSecure. We do have  very similar code and on one machine, where we have qlik from April 2018 (12.16), it is working fine and on the other one, where we have Feb 2019 version (13.9), we have exactly the same problem as Tony_empiredev. Application code is the same, only qlik versions are different.

Tony_empiredev have you been able to find solution for this problem?

My colleagues suggested to copy new require.js from qlik installation (C:\Program Files\Qlik\Sense\Client\assets\external\requirejs) and replace it in our client code. He claims it helped when we switched last time to new version of qlik. I tried it, but it does not seem to resolve the issue. I wish someone from Qlik side would distribute notes with advise what to do when pushing potentially breaking changes.

petermicuch
Contributor II
Contributor II

Small update. Copying the "require.js" file actually helped. Last time I tried update of docker image with our application was not generated correctly. After another try this works, but it is quite annoying to copy this require.js file whenever new version of Qlik is out there. Has anyone better solution? 

neeraj712
Partner - Contributor II
Partner - Contributor II

Please add details from where to which location you copied require js. My qlik sense extension worked fine for Feb '19 release but with April 2019 release broke with error - Load timeout for modules:

petermicuch
Contributor II
Contributor II

Location "from where" is mentioned in my previous post. Location "to where" has to be known by you or the one who wrote client code to display Qlik stuff on your side. It differs from implementation to implementation.