Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qlik Sense integration in web app

Hi,

I am trying to integrate qlik sense into our web application. I am having trouble with require js set up. Our application usage requirejs internally and defines the local modules in our main js.

Qlik sense and our web app are installed on separate sub domains.

We have one entry for require using data-min as follows.

<script type="text/javascript" data-main="main" src="http://qlikurl/proxy/resources/assets/external/requirejs/require.js" ></script>

Since requirejs provided by qlik sense has few other modules embedded so we are using that.

Now when we trying to load qlik js using

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

I am getting errors. Sometime it tries to load local resources from qlik sense server. Its behavior is sporadic.

I understand now there are two base url one for loading qlik sense resources and one from our local app. I tried different ways to initialize require but nothing works , specially after version 3.

I just want to know how people are using it.

Thanks

-Vishal

1 Solution

Accepted Solutions
Francis_Kabinoff
Former Employee
Former Employee

You can check out how I do it here

GitHub - fkabinoff/qlik-lars: Qlik Sense Mashup Template

I set a different context for my own stuff. The only issue I've run into is if I try to get an object with an extension within my code, which has the custom context. This may not even be a problem for you, but you could get around it I'm pretty certain by just registering any extensions you may be using in the default context.

https://help.qlik.com/en-US/sense-developer/3.0/Subsystems/APIs/Content/MashupAPI/Methods/registerEx...

View solution in original post

4 Replies
Alexander_Thor
Employee
Employee

In your script file make sure you define require.config with a correct basepath pointing to the server.

If you already have require on the page then I guess that could cause trouble loading via the data-main attribute, try placing a reference to your code in a script tag after the require script tag, won't load async but it's something to try to isolate the problem at least

Francis_Kabinoff
Former Employee
Former Employee

You can check out how I do it here

GitHub - fkabinoff/qlik-lars: Qlik Sense Mashup Template

I set a different context for my own stuff. The only issue I've run into is if I try to get an object with an extension within my code, which has the custom context. This may not even be a problem for you, but you could get around it I'm pretty certain by just registering any extensions you may be using in the default context.

https://help.qlik.com/en-US/sense-developer/3.0/Subsystems/APIs/Content/MashupAPI/Methods/registerEx...

Anonymous
Not applicable
Author

Thanks a lot Francis for your comments.

As you suggested I created different require context for my own js. I loaded qlik js from qlik sense server.

Now I am getting 404 for assets/general/require-config.


This is defined inside qlik.js , I am not sure why require is trying to fetch this.

Thanks

-Vishal

Anonymous
Not applicable
Author

Looks like I had to set require.config baseurl to qlik server before my own require context config.