Duplicated Bootstrap assets

I’m running into a problem that appears to be caused by duplicated Bootstrap .js assets.

I’m using Jasny Bootstrap via bower, and the problem arises after installing it, where dropdowns stop working. After running gulp I checked the main.js inside /dist and effectively I can see repeated blocks of code.

I’ve tried to troubleshoot via bower.json files but can’t find how to override this, as apparently the Jasny Bootstrap bower.json is not loading Bootstrap itself (already tried removing bootstrap dependency).

bower list without jasny-bootstrap:
├─┬ bootstrap-sass-official#3.3.5
│ └── jquery#2.1.4
└── modernizr#2.8.2 (latest is 2.8.3)

bower list with jasny-bootstrap:
├─┬ bootstrap-sass-official#3.3.5
│ └── jquery#2.1.4
├─┬ jasny-bootstrap#3.1.3
│ ├─┬ bootstrap#3.3.5
│ │ └── jquery#2.1.4
│ └── jquery#2.1.4
└── modernizr#2.8.2 (latest is 2.8.3)

Any help is greatly appreciated.

Did you try searching? Possible reordering of main.css and main.js rendering

1 Like

was trying different keywords… still stuck on this but getting closer, thanks?

Got it working modifying sage’s bower.json with the following overrides:
(as suggested here: Possible reordering of main.css and main.js rendering)

"jasny-bootstrap": {
  "main": [
    "./dist/css/jasny-bootstrap.css",
    "./dist/js/jasny-bootstrap.js"
  ],
  "dependencies": {
    "jquery": ">= 1.9.0",
    "bootstrap-sass-official": "3.3.5"
  }
}
2 Likes