question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'slidesToShow' of undefined

See original GitHub issue

short description of the bug / issue, provide more detail below.

Getting Uncaught TypeError: Cannot read property 'slidesToShow' of undefined on the first click of a customPaging button, but then the slideshow works fine after that.

====================================================================

http://jsfiddle.net/kyleknighted/pofc1qmv/3/

====================================================================

Steps to reproduce the problem

  1. on load or click into any tab
  2. click any customPaging button
  3. Check your browser’s Console and see the aforementioned error.
  4. Click any button again and the slide will change to the proper one

====================================================================

What is the expected behavior?

Not to have an error the first time i click a button

====================================================================

What is observed behaviour?

I’m getting an error.

====================================================================

More Details

  • Chrome Version 56.0.2924.87 (64-bit) is the only current tested version, but that’s already too many browsers.
  • jquery = 1.12.4
  • Slick = 1.6.0

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:3
  • Comments:11

github_iconTop GitHub Comments

136reactions
rudenichcommented, Sep 28, 2017

If you use “asNavFor” option, be sure that you provide correct link to another slider, otherwise you get that error.

4reactions
sebszocinskicommented, May 19, 2018

I was seeing this error when using Ajax and leaving a page… turns out the autoplay is still trying to run after the slick container is now gone… so you get those errors… my fix was to apply: $('#your-slick-element').slick('slickPause'); when I left the page that has Slick.

Note: you might need to do this on both slick elements if you’re using asNavfor

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read properties of null (reading 'add') - Stack Overflow
below is my slider code i got error of can't read property of null reading add kindly do needfull $('.main_images').slick({ slidesToShow: 1, ...
Read more >
Cannot read property 'slidesToShow' of undefined
Hi,. I just wanted to report the following javascript error: “Uncaught TypeError: Cannot read property 'slidesToShow' of undefined”.
Read more >
Slider not working - WordPress.org
slick.min.js?ver=2.1.2:1 Uncaught TypeError: Cannot read property 'slidesToShow' of undefined at Object.e.slideHandler (slick.min.js?ver=2.1.2:1)
Read more >
slick slider error Uncaught TypeError: Cannot read property ...
Uncaught TypeError: Cannot read property 'add' of null in browser ... speed: 300, slidesToShow: 3.1, settings: "unslick", slidesToScroll: 1, ...
Read more >
slick - the last carousel you'll ever need - Ken Wheeler
To use lazy loading, set a data-lazy attribute // on your img tags and leave off ... If you already have the "float"...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found