Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Not applicable

Mashup objects load inconsistently - qlik.openApp is not a function

Hi,

I am creating mashup pages and deploying them on QlikSense server (3.0).

We are facing the issue that the mashup pages are sometimes not loading any of the Qlik objects when the page is opened. The full structure of the HTML will load, but the Qlik objects do not load at all. The current selections bar does not appear either, so it is like it is not able to establish the connection with the app / engine at all.

However, after clicking refresh a few times (same network connection etc) then the objects will eventually load with no issues. There seems no pattern to the number of refreshes needed, apart from issues seeming to occur more often with larger apps.

Below is a snip of the console message. The 'qlik.openApp is not a function' error is what appears in the case when the app won't load.

After seeing some other threads, I tried updating the waitSeconds parameter in the require.config to 0 but this didn't fix the issue.

Attached the full js file being used.

Capture.PNG

4 Replies
Not applicable

Re: Mashup objects load inconsistently - qlik.openApp is not a function

Does anybody have any suggestions on this?

Is anybody else experiencing mashup pages that do not always load the Qlik objects, and just display the empty HTML structure?

vegard_bakke
Contributor

Re: Mashup objects load inconsistently - qlik.openApp is not a function

We are experiencing the same problem. With Qlik Sense 3.2.1.

The:

   require(["js/qlik"], function (qlik) {

     qlik.openApp(......)

fails with:

     Uncaught TypeError: qlik.openApp is not a function

Actually, console.log(qlik) outputs:

      Object {Promise: function, polyfill: function}

So it looks like the variable 'qlik' is a Promise, and not the proper qlik object. But not always!

erik_wetterberg
Valued Contributor III

Re: Mashup objects load inconsistently - qlik.openApp is not a function

Hi,

Actually you get an object that contains a function called Promise and a function called polyfill. The Promise function should be there (though I'm not sure it's documented), haven't seen the polyfill function before and there should be some more functions, like the one you need, openApp.

When I'm running with 3.1 I get the following (which works):

Capture.JPG

Do you get any other errors? Is the require call just like above? It is important that you use "js/qlik" as dependency. Do you load anything else that might interfere with requirejs??

Hope this helps

Erik Wetterberg

Erik Wetterberg
https://extendingqlik.upper88.com/
vegard_bakke
Contributor

Re: Mashup objects load inconsistently - qlik.openApp is not a function

Yes, that is the object we get when it _does_ work. However, a lot of the time, we get the following object:

Sense-Qlik-Promise.png

Sometimes we are getting the error message: Uncaught Error: Mismatched anonymous define() module.

I just don't understand how requireJS can sometimes provide the correct object, and sometimes not.

It can definitely be a timing issue, or two libraries stepping on each other's feet.

We are trying to use mashup in Salesforce, which uses the library Aura (Angular like).

A two year old post indicated that there might be an issue betewwn Aura and RequireJS (javascript - Is Aura not compatible with require.js? - Salesforce Stack Exchange), but I don't know if this is still the case.

Regards,

Vegard