Bootstrap dropdown require Popper.js

Hi guys, I have a problem with adding Bootstrap 4 (4.0.0-beta) to my meteor project. Actually it says “Bootstrap dropdown require Popper.js” because bootstrap expects Popper global variable. Maybe there are any other ways to do this or anyone solved this already?

Here is example of my code.

import Popper from 'popper.js'; //popper.js is a package in node_modules

window.Popper = Popper;

import 'jquery';

console.log(Popper);
import 'bootstrap'

Meteor.startup(() => {
~~~~
});

Did you end up fixing this? So far only Bootstrap 3 works for me.

I tried using global.Popper and window.Popper, but the error still comes up. How did you include bootstrap in your project? So far I’m using

import 'bootstrap';
import '/node_modules/bootstrap/dist/css/bootstrap.min.css';

in my main app.jsx file.

EDIT: I got it to work. However, I had to use the Popper CDN. If there is another way that doesn’t rely on the CDN, please reply.

For some reason, I got it to work by putting it in a separate file

// imports/startup/client/index.js
import './popper';
// imports/startup/client/popper.js
import Popper from 'popper.js';
window.Popper = Popper;
2 Likes

I fixed it exactly the same way, I think this problem caused by imports and other stuff execution order

I ran in to issues with Bootstrap 4.

Rolled back to BS3 :frowning:.

1 Like