Jabaa
Jabaa

Reputation: 1763

Web pack build in laravel : Bootstrap's JavaScript requires jQuery error

Here is my script for webpack build with laravel mix

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

Upvotes: 0

Views: 705

Answers (1)

Deathstorm
Deathstorm

Reputation: 857

i've had this issue quite a while ago. In my case after some googling i came to the conclusion that i forgot to install the bootstrap-sass-loader so incase that you are using the bootstrap-sass package do make sure you've installed the loader aswell. You can do this by running the following command:

$ npm install bootstrap-sass-loader --save

If this isn't the case try to take a look at this it isn't a tutorial for your problem exactly but it does show some simulair tutorials and answers.

Hope it helps!

Upvotes: 1

Related Questions