Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
feliperesende
Contributor II
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

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
Aiham_Azmeh
Employee
Employee

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

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/

balabhaskarqlik

feliperesende
Contributor II
Contributor II
Author

I implemented your help and it worked !!

Thank you!