question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bootstrap's JavaScript requires jQuery with bootstrap build

See original GitHub issue

const { mix } = require(‘laravel-mix’);
mix.js([ ‘public/admin/js/jquery.js’, ‘public/admin/js/bootstrap.min.js’, ],‘production/js/final.js’);

But when i include final.js i got the following error

Uncaught Error: Bootstrap's JavaScript requires jQuery

I’ve installed the jquery with npm install jquery --save but still i got above error

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

28reactions
ProExpertProgcommented, Aug 3, 2017

For all the future googlers, I solved the problem with

mix.autoload({
    jquery: ['$', 'window.jQuery',"jQuery","window.$","jquery","window.jquery"]
});

EDIT: Add this before all your calls to mix.js() and mix.scss() etc.

11reactions
ruchernchongcommented, May 19, 2017

In app.js add

window.$ = window.jQuery = require('jquery')
Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap throws Uncaught Error: Bootstrap's JavaScript ...
You need to add JQuery js before adding bootstrap js file, because BootStrap use jqueries function. So make sure to ...
Read more >
[Solved] Uncaught error: bootstrap's javascript requires jquery
I got an error Bootstrap's JavaScript requires jQuery. Here my scripts Order. HTML. < ...
Read more >
Uncaught Error Bootstrap s JavaScript requires jQuery - Edureka
I am trying to use Bootstrap to make an interface for a program. I added jQuery 1.11.0 to the <head> tag and thought...
Read more >
Uncaught TypeError: Bootstrap's JavaScript requires jQuery ...
I have noticed that disabling Bootstrap Library modules gets ride off the issue. Copy bootstrap library to web/library. You can re-enable System ...
Read more >
JavaScript · Bootstrap v5.0
Bootstrap 5 is designed to be used without jQuery, but it's still possible to use our components with jQuery. If Bootstrap detects jQuery...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found