Bootstrap throws Uncaught Error: Bootstrap’s JavaScript requires jQuery

Bootstrap throws Uncaught Error: Bootstrap's JavaScript requires jQuery
Bootstrap throws Uncaught Error: Bootstrap’s JavaScript requires jQuery

The “Uncaught Error: Bootstrap’s JavaScript requires jQuery” error occurs when the Bootstrap library is being loaded in a web page, but the jQuery library is not present or is not being loaded correctly. Bootstrap’s JavaScript plugins rely on the jQuery library, so it must be loaded before Bootstrap’s JavaScript code is executed.

Here are some common causes of this error:

  • jQuery library is not included in the webpage
  • jQuery library is included but it’s loaded after Bootstrap’s JavaScript
  • jQuery library is included but it’s a wrong version
  • jQuery library is included but there is a typo in the path

To fix this error, you will need to make sure that the jQuery library is properly included in the webpage before the Bootstrap’s JavaScript is loaded. You can do this by including the jQuery library in the head of your HTML document before Bootstrap’s CSS and JavaScript files.

You can also check to make sure that the jQuery library is included only once, and that the path to the library is correct. Also, check that you are using the correct version of jQuery. Bootstrap specifies a range of compatible jQuery versions, and you should use a version that falls within that range.

It is also recommended to check the browser’s developer tools to see if there are any console errors related to jQuery or Bootstrap, as that could help you to debug the problem.

Leave a Reply