Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
master_t
Partner - Creator II
Partner - Creator II

Merging an extension into a single .js file

Hello fellow devs.

This is kind of a weird question, so let me tell you the reason behind this before I ask it.

For some time now I've been having a strange issue with Qlik Sense Cloud, where our extensions (that work normally in QS Enterprise) sometimes, apparently at random, fail to load in QS Cloud.

I've checked the browser network logs and it turns out that when this happens, it is because some files that are part of the extension package are not returned by the server, which instead returns a 404 error. This appears to be completely random, for example in this case:

master_t_0-1673341478823.png

three of the files failed to load, but the next time it might be two or one or none, and never the same ones.  And if I refresh the page the issue goes away and the files load correctly, suggesting maybe a problem with the QS Cloud infrastructure (maybe on a load balancer? I'm not an expert in network architecture honestly, what I know is that the server is telling my browser that a file that actually exists doesn't exist 😅)

I am already in contact with Qlik support about this, they're trying to help me but they said they might not be able to, because basically when working with 3rd party extensions "you're on your own" even though this seems more like a server-side issue than anything else.

In the meantime however I'm trying to find a workaround to minimize the annoyance for our clients that are using the extension in the cloud, and so we finally come to my question:

to mitigate the problem I thought of trying to merge the various JS files that are part of the extension into a single JS file, following the logic that if the chance of a file failing to load is random then with a single file that would be a 1 out of X chances of failure instead of a 7 out of X chances like it is now.

I wanted to know if anyone has done something similar to a Qlik extension before and knows of any tools that would help me achieve this (I've read about webpack, but I've never used it and I don't know if it is the correct tool for the job).

Does anyone have any suggestions/guides?

Labels (2)
1 Solution

Accepted Solutions
Shai_E
Support
Support

Hello,

 

Maybe the following resources can help you:

Bundling js files with webpack script

javascript - Bundle JS files with webpack scripts? - Stack Overflow

To go with this, webpack documentation with the concept of "entry point"

Concepts | webpack

 

There is another tool that might help but i didnt test, "PHP Minify"

php - Multiple javascript/css files: best practices? - Stack Overflow

View solution in original post

1 Reply
Shai_E
Support
Support

Hello,

 

Maybe the following resources can help you:

Bundling js files with webpack script

javascript - Bundle JS files with webpack scripts? - Stack Overflow

To go with this, webpack documentation with the concept of "entry point"

Concepts | webpack

 

There is another tool that might help but i didnt test, "PHP Minify"

php - Multiple javascript/css files: best practices? - Stack Overflow