I installed via npm bootstrap 4.6.0 and jquery 3.6.0.
This code is working:
import jQuery from "jquery/dist/jquery";
import "bootstrap/dist/js/bootstrap";
(function ($) {
"use strict";
$("[data-toggle='tooltip']").tooltip()
})(jQuery);
This code instead is not working, with error Uncaught TypeError: $(...).tooltip is not a function
Notice that the only difference is that jquery slim is used in place of jquery.
import jQuery from "jquery/dist/jquery.slim";
import "bootstrap/dist/js/bootstrap";
(function ($) {
"use strict";
$("[data-toggle='tooltip']").tooltip()
})(jQuery);
Other bootstrap functionalities (e.g. collapse) work even with slim.
It looks like for some reason bootstrap fails to load some functions, like tooltip (also tried with scrollspy, same problem)
I also tried to console.log($.fn) and actually with jquery slim I can't find a bunch of functions...