0

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

4
  • You're mixing a dependent stuff into one entry. The order may wrong or it just don't work either. Laravel has an example on how to bootstrap them by default. Commented May 19, 2017 at 10:17
  • Can you please elaborate your comment?? Commented May 19, 2017 at 10:20
  • github.com/laravel/laravel/blob/master/resources/assets/js/… Commented May 19, 2017 at 10:21
  • I didn't get how this will relate to my problem?? Commented May 19, 2017 at 10:25

1 Answer 1

1

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!

Sign up to request clarification or add additional context in comments.

4 Comments

wait Let me try it
@Jabaa Then you should take a look at the link i've put in my answer maybe that gives the solution to your problem
Thats ROR tutorial here i am using laravel
yes iknow @Jabaa it isn't a laravel tutorial but it does have simulair workflow's. Besides the link was and is a suggestion. Not an answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.