Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webpack Installing Bootstrap - missing popper.js.map

I followed the instructions in https://getbootstrap.com/docs/4.0/getting-started/webpack/ and I also installed jquery and popper.js with npm.

Still when I use the output bundle.js, the browser keeps on sending GET requests for popper.js.map and I need all the assets to be part of the bundle.js.

I searched a lot for the proper answer but none that explains whats wrong with the instructions mentioned above, exists. Please help.

like image 212
yoni.str Avatar asked Nov 29 '17 09:11

yoni.str


People also ask

Do I need to install popper for bootstrap?

Bootstrap depends on Popper, which is specified in the peerDependencies property. This means that you will have to make sure to add both of them to your package.

Does bootstrap 4 require Popper js?

However, Bootstrap 4 can be used without Popper. js, if we don't use tooltips, popovers nor dropdowns. For example, navbar's JS functionality (mobile menu on the right) works well without Popper. js.

Is Popper js a bootstrap dependency?

Bootstrap has dependency on Jquery and Popper js.


2 Answers

At the very end of the popper.js file there is a comment like this:

//# sourceMappingURL=popper.js.map 

Removing the commented line fixed the issue for me.

like image 132
Hoodlum Avatar answered Sep 26 '22 05:09

Hoodlum


If you are using Laravel 5+ and/or Laravel Mix, this should help:

To make the warning go away, simply add .sourceMaps() to your js-file(s) in webpack.mix.js:

mix.js('resources/js/app.js', 'public/js').sourceMaps(); 

The method will tell Laravel Mix to includes the source maps, since they are disabled as default.

like image 22
KFoobar Avatar answered Sep 25 '22 05:09

KFoobar