0

I am trying to load bootstrap.js using browserify, Laravel elixir. I use npm to install the packages. Everything seems good but when i try to load my page is shows "Error: Bootstrap's JavaScript requires jQuery". I have googled lot but didn't find any solution that works. Here is my codes :

resources/assets/js/app.js

import $ from 'jquery';
import Bootstrap from 'bootstrap-sass'

package.json

{
    "private": true,
    "scripts": {
        "prod": "gulp --production",
        "dev": "gulp watch"
    },
    "devDependencies": {
        "gulp": "^3.9.1",
        "laravel-elixir": "^5.0.0",
        "bootstrap-sass": "^3.0.0",
        "laravel-elixir-vueify": "^1.0.0"
    },
    "dependencies": {
        "jquery": "^2.2.4"
    }
}
5
  • I modified your question. The elixir tag which you picked refers to the Elixir programming language not elixir as in laravel. I've added the correct tag for you. Commented May 24, 2016 at 19:48
  • No worries. Just thought you might wonder why I retagged the question. Commented May 24, 2016 at 22:56
  • yes.. bro can u help me out from my problem?? Commented May 24, 2016 at 22:58
  • Sorry - - know next to nothing about that. Commented May 24, 2016 at 22:59
  • ah!! ok.. ty to correct me :) Commented May 24, 2016 at 23:00

1 Answer 1

1

Finally I have come up with the following approach :

instead of using :

import $ from 'jquery';

use :

window.jQuery = window.$ = require('jquery');
Sign up to request clarification or add additional context in comments.

Comments

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.