1

I am using the Bootstrap Tour plugin and Bootstrap 5 on my website. I am getting one error in the console.

Uncaught TypeError: n.data(...) is undefined

Bootstrap 5 doesn't support the Bootstrap Tour?

$(document).ready(function() {
  var tour = new Tour({
    steps: [{
        element: "#guide1",
        title: "Title of my step",
        content: 'Welcome, let us show you around',
      },
      {
        element: "#guide2",
        title: "Title of my step",
        content: 'This is second steps.',
      },
      {
        element: "#guide3",
        title: "Title of my step",
        content: 'This is third steps',
      }
    ]
  });

  // Initialize the tour
  tour.init();

  // Start the tour
  tour.start();
  // })();
});
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.12.0/css/bootstrap-tour.min.css" integrity="sha512-sFyS37kke5UvcMHcV8k0NSAT2QWjeLEXKVm0JOXgFd8cd1XMMWqez/mL64g6m+HAS8jBjvPwi5ctTiYX2BRRpQ==" crossorigin="anonymous" referrerpolicy="no-referrer"
/>
<div class="" id="guide1">
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
    dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>

<div class="" id="guide2">
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
    dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>


<div class="" id="guide3">
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
    dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>


<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.12.0/js/bootstrap-tour.min.js" integrity="sha512-kcDHM4gaMoZGaCaJ56XjGiknuwMeQFxssvIDnuuCp22PJYO8XvOeMibWtkdZTZtbPXfvLE9WweEVToVtM/wlMw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
Naren Verma
  • 2,205
  • 5
  • 38
  • 95
  • Your provided code (and when copied to a jsfiddle) give a different error. *Cannot read properties of undefined (reading 'tip')*. Could it be a version mismatch? The bootstrap-tour doesn't say which versions of libraries to use, which is somewhat remiss. – freedomn-m Mar 15 '22 at 17:59
  • @freedomn-m, I am using both latest versions. You can checkout the error in the snippet – Naren Verma Mar 15 '22 at 18:35
  • Yes, I can read the error it's clearly `Cannot read properties of undefined (reading 'tip')` which is not even remotely the same as `Uncaught TypeError: n.data(...) is undefined`. You might be using the latest versions, but doesn't mean -tour is compatible with the latest versions. – freedomn-m Mar 16 '22 at 05:27
  • @freedomn-m, Not sure why you are getting the error 'Cannot read properties of undefined '. I am getting only 'Uncaught TypeError: n.data(...) is undefined'. You can also check in the above snippet. How can We solve this issue? – Naren Verma Mar 16 '22 at 06:37
  • Either way, there's clearly an error somewhere... – freedomn-m Mar 16 '22 at 06:44
  • @freedomn-m, I tried but haven't found the solution – Naren Verma Mar 16 '22 at 07:17

0 Answers0