Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Highlighted
feliperesende
New Contributor II

Compatibility error in "require.js" file with "bootstrap.js" 4.0

Hello!

I'm developing a mashup and, at the same time, I need to use version 4.0 of the bootstrap.

However, by including the bootstrap javascript file, an error occurs in the require.js file, possibly due to the incompatibility of the two files (bootstrap.js and require.js).

When I create a new mashup from scratch, it uses version 3.3.7 of the bootstrap.

Does anyone know what the error might be when I use version 4.0 of bootstrap? Have you been through this?

Note: Here is an attached image of the error that happens.

1 Solution

Accepted Solutions
ErikWetterberg
Honored Contributor

Re: Compatibility error in "require.js" file with "bootstrap.js" 4.0

Hi Felipe,

I came across this some time ago, with an earlier version of Bootstrap 4. The problem is that Bootstrap 4 needs a newer version of jQuery, and the jQuery that is bundled with Qlik Sense (actully in the requirejs file) overwrites that one.

I don't know if my solution is the best, there might be a more elegant one, but I did like this, basically saving the Bootstrap4 jQuery instance before loading the qlik version, and then restoring it:

<script src="node_modules/jquery/dist/jquery.slim.min.js"></script>

  <script src="node_modules/tether/dist/js/tether.min.js"></script>

  <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>

  <script>

   window.jQueryB = window.jQuery;

  </script>

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

  <script>

   window.$ = window.jQuery = window.jQueryB;

  </script>

Hope this helps

Erik Wetterberg

https://extendingqlik.upper88.com/

View solution in original post

4 Replies
Employee
Employee

Re: Compatibility error in "require.js" file with "bootstrap.js" 4.0

Hi Felipe,

Qlik Sense is using jquery 3.0  and there is a known compatibility issue between bootstrap 4 and jquery 3 =>

https://github.com/twbs/bootstrap/issues/19433

Maybe that's the issue

I hope this helps

ErikWetterberg
Honored Contributor

Re: Compatibility error in "require.js" file with "bootstrap.js" 4.0

Hi Felipe,

I came across this some time ago, with an earlier version of Bootstrap 4. The problem is that Bootstrap 4 needs a newer version of jQuery, and the jQuery that is bundled with Qlik Sense (actully in the requirejs file) overwrites that one.

I don't know if my solution is the best, there might be a more elegant one, but I did like this, basically saving the Bootstrap4 jQuery instance before loading the qlik version, and then restoring it:

<script src="node_modules/jquery/dist/jquery.slim.min.js"></script>

  <script src="node_modules/tether/dist/js/tether.min.js"></script>

  <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>

  <script>

   window.jQueryB = window.jQuery;

  </script>

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

  <script>

   window.$ = window.jQuery = window.jQueryB;

  </script>

Hope this helps

Erik Wetterberg

https://extendingqlik.upper88.com/

View solution in original post

balabhaskarqlik
Honored Contributor

Re: Compatibility error in "require.js" file with "bootstrap.js" 4.0

feliperesende
New Contributor II

Re: Compatibility error in "require.js" file with "bootstrap.js" 4.0

I implemented your help and it worked !!

Thank you!