0

I used gem 'bootstrap' to upgrade a Rails project to Bootstrap 4. Then the dropdowns failed due to missing 'popper.js'. According to the documentation I had to add 'bootstrap.bundle.js' which includes 'popper.js' only (https://getbootstrap.com/docs/4.1/getting-started/contents/#js-files).

So far so good until I attempted to add 'bootstrap-select' (latest version 1.13.2) when the same error occured:

bootstrap.self.js?body=1:1554 Uncaught TypeError: Bootstrap dropdown require Popper.js (https://popper.js.org)
    at Dropdown.toggle (bootstrap.self.js?body=1:1554)
    at HTMLButtonElement.<anonymous> (bootstrap.self.js?body=1:1725)
    at Function.each (jquery3.self.js?body=1:355)
    at jQuery.fn.init.each (jquery3.self.js?body=1:190)
    at jQuery.fn.init._jQueryInterface (bootstrap.self.js?body=1:1710)
    at HTMLButtonElement.<anonymous> (bootstrap.self.js?body=1:1882)
    at HTMLDocument.dispatch (jquery3.self.js?body=1:5184)
    at HTMLDocument.elemData.handle (jquery3.self.js?body=1:4992)

Somehow 'bootstrap-select' ignores 'bootstrap.bundle.js' and if I add 'popper.min.js' or gem 'popper_js' it won't fix the error. Any thoughts pls?

s0rin
  • 127
  • 1
  • 9
  • The new bundles are only added in the *absolute* latest version of Bootstrap, so it *is* possible that they've missed some references. I'd recommend not worrying about the bundles, and instead referencing both independently -- `popper.min.js` *before* `bootstrap.min.js`. Don't forget jQuery too! – Obsidian Age Nov 07 '18 at 21:41
  • It seems I forget to add **//= require popper** into **application.js** as is described here: https://github.com/glebm/popper_js-rubygem#usage After that the error has disappeared. – s0rin Nov 08 '18 at 09:02

0 Answers0