Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
catalin
Partner - Contributor III
Partner - Contributor III

RequireJs resources import error with QS version > August 2024

Hello,

We have a strange problem that did not occur with any version of QlikSense until August 2023.

We are using various QS APIs to integrate some visuals in a Blazor page. 

In _Host.cshtml we are using:

 <script src="js/require.js"></script>
 <script src="js/qlikInterop.js"></script>  

In our interop .js file we have:

var config = {
  port: "443",
  isSecure: true,
  identity: generateRandomIdentity(16),
};
require.config({
        waitSeconds: 200,
        baseUrl:
          (config.isSecure ? "https://" : "http://") +
          host +
          (config.port ? ":" + config.port : "") +
          prefix +
          "resources",
      });
      require(["js/qlik"], function (qlik) {
        let resultTooLarge = false;
        qlik.setOnError(function (error) {
          if (error.message == "Result too large") {
            resultTooLarge = true;
          }
          console.error(error);
        });

        qlik.theme.apply(theme).then(function (result) {
          console.log(theme);
          console.log("theme applied with result: ", result);
... so on and so forth.

 

The Blazor app is hosted on localhost, with a specific port.

Let's suppose https://localhost:5055

Now, when RequireJS tries to load modules, it does not use the baseUrl default 443 port and always tries with https://localhost:5055/virtual_proxy_prefix/resources/blabla instead https://localhost/virtual_proxy_prefix/resources/blabla, thus ending in an error because, ofc, it cannot find the required resource.

See image bellow:

 

catalin_0-1707297298992.png

 

The current setup worked until May 2023 and started to behave like I am describing since August 2023 version and upwards.

What am I missing? Does anyone have any tips related to what was changed that started causing this behavior? 

Thank you,

Catalin

Labels (4)
5 Replies
jprdonnelly
Employee
Employee

@catalin - this seems to be related to a fix in the latest patches. The August 2023 post here in Community doesn't mention the update, but it does for May 2023 and November 2023 (QB-23501). Please look at the release notes for May 2023 Patch 13, I believe that they should align with August 2023 Patch 10

- @jprdonnelly
catalin
Partner - Contributor III
Partner - Contributor III
Author

Hi and thank you for replying.

We updated to the latest patch November 2023 and have the same error.

Something happened after the May version. It is easily reproducible.

If you try with any version bigger or equal to August 2023 you will encounter the error when RequireJS is not using the config's base URL to access the resources.

Is there any workaround available? Any tips?

 

catalin
Partner - Contributor III
Partner - Contributor III
Author

Hi, @jprdonnelly 

Do you have any insights? Does someone from support able to reproduce this? 

Thanks a lot for any info.

Catalin

jprdonnelly
Employee
Employee

@catalin - I spoke too soon, though it is now actually fixed in February 2024 IR via QB-24345

The bug should only surface if you are running the mashup/webapp on the same host as your Sense server, but on different ports.

- @jprdonnelly
catalin
Partner - Contributor III
Partner - Contributor III
Author

Hi,

So if I have November 2023 installed, I should install the latest patch for November 2023, meaning patch 5, released on 21/02/ 2024, and this patch will contain the QB-24345 fix, right?

I did this, but no change.

Same result. 

We, indeed, use a web app on the same host with a specific port.

Now event if you reference / load require.js like this:

 <script src="https://your_qs_hostname/resources/assets/external/requirejs/require.js"></script>

 

And then try to load the app, it loads the app, then immediately loses connection, and the app properties look like this:

 

catalin_0-1708680354935.png