bulma-carousel: Uncaught ReferenceError: bulmaCarousel is not defined

Hi, In my Laravel project, carousel is included

require('bulma-extensions/bulma-carousel/dist/bulma-carousel');

but

var carousels = bulmaCarousel.attach();

produces the said error. Carousel styling is fine but slider part is not working.

Any suggestion? Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 25 (11 by maintainers)

Commits related to this issue

Most upvoted comments

We need to define bulmaCarousel explicitly. This works perfectly with Laravel Mix/Webpack.

SASS
@import "node_modules/bulma-extensions/bulma-carousel/dist/css/bulma-carousel.sass"
JS
var bulmaCarousel = require('bulma-extensions/bulma-carousel/dist/js/bulma-carousel');
bulmaCarousel.attach();

Arf… I’ll check this extension completely tomorrow.

  1. in webpack.mix.js update the mix command to: mix.js(‘resources/assets/js/app.js’, ‘public/js’) .sass(‘resources/assets/sass/app.scss’, ‘public/css’) .copy(‘node_modules/bulma-extensions/bulma-carousel/dist/js/bulma-carousel.js’, ‘public/js’);

  2. in your view include the JS file now available from the public/js folder and then init the extension using var carousels = bulmaCarousel.attach()

I did but I a am getting same error. I have other extensions imported in similar manner. Tags Input is working fine.

Whether I do attach or not. Carousel slider is not working.