Jquery – why is slick carousel not working with browserify


I'm trying to use slick carousel (http://kenwheeler.github.io/slick/) and installed via npm.

Including it via browserify like this:

slick = require('slick-carousel')

trying to run like this:


No console errors, carousel not initialising. What's going on?

Best Solution

NOTE: It's not recommended to edit library. If still in case you want a workaround then you can follow like below.

I also had the same problem with using slick with browserify but none of solutions worked for me. Then i take a took into slick.js and changed -


(function(factory) {
    'use strict';
    if (typeof define === 'function' && define.amd) {
        define(['jquery'], factory);
    } else if (typeof exports !== 'undefined') {
        module.exports = factory(require('jquery'));
    } else {

}(function($) {


;(function ( $, window, document, undefined ) {

add the last line -




})( jQuery, window, document );

Hope it helps to understand the problem.