Search code examples
javascriptcsstwitter-bootstraptwitter-bootstrap-4bootstrap-tour

Bootstrap-tour with Bootstrap 4 alpha 6 n.popover is not a function


Trying to use bootstrap-tour with bootstrap 4 and am getting the followng error:

TypeError: n.popover is not a function

I am initializing the code like this:

var tour = new Tour({
            steps: [
                {
                    element: "#nextLesson",
                    title: "Title of my step",
                    content: "Content of my step"
                }
            ]
        });
        tour.init();
        tour.start();

Solution

  • You have to initialize popover plugin that tour depends on:

    $(function () {
        $('[data-toggle="popover"]').popover()
    });