I have installed Views Slideshow 8.x-4.5 on Drupal 8.3.7 as well as the required dependancies as per the README file.
The slideshow that I have created works perfectly in the preview window at the bottom of the Structure > Views screen. However, when I add the block to the Header section of the front page, only the first slide is displayed as a static image. The following error is displayed in the Javascript console:
drupal.js:59 Uncaught TypeError: Cannot read property '#views_slideshow_cycle_main_slideshow-block_1' of undefined
at HTMLDivElement.<anonymous> (views_slideshow_cycle.js:15)
at Function.each (jquery.min.js:2)
at n.fn.init.each (jquery.min.js:2)
at Object.attach (views_slideshow_cycle.js:13)
at Object.Drupal.attachBehaviors (drupal.js:160)
at drupal.init.js:17
at HTMLDocument.t (ready.min.js:4)
I have tried clearing the cache to no avail.
What is causing this please and how can it be resolved?
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | views_slideshow-duplicate-ids.patch | 788 bytes | khaldoon_masud |
Comments
Comment #2
ziady commentedI ran into the same issue, with the following errors:
TypeError: drupalSettings.viewsSlideshowPagerFields is undefined
TypeError: drupalSettings.viewsSlideshowPagerFields is undefined
In my case, it was the use of the tag in the body of my slideshow node that was causing the problem. When I removed that tag, the slideshow worked again. I was able to replicate and correct this issue on my Dev and Production sites; I don't know enough about it to help with the underlying cause.
I found some info at https://drupal.stackexchange.com/questions/210984/how-to-fix-uncaught-ty...
Comment #3
lynettew commentedI've had a similar experience, but a different error. I'm on Drupal 8.4.0, and have installed Views Slideshow 8.x-4.5 with all libraries. Upon further inspection, the error I was getting was:
When I looked at the jquery.cycle.all.js file this is what it looks like:
If I take off the cache busting, the file reads perfectly normal. I have tried deleting the file and creating by copying pasting, I have deleted everything and created again, and I have tried creating the view with different show settings and block display settings just to see if anything of that sort would do anything. The file keeps displaying corrupted pretty much no matter what I do.
I'm going to try a few more things in the back end, and will let you know if anything works.
Comment #4
nickdickinsonwildeDo you still have an example available that's failing? - It *shouldn't* do that and I'm not sure what configuration would make it do that
Comment #5
streever commentedI have the same issue but it's local; it only happens on my subtheme of Bartik, but it works on Admin theme or if I change to Bartik.
OP, did it only happen to you in subtheme?
Comment #6
nickdickinsonwildeAre you properly rendering the DrupalSettings JSON?
Comment #7
nickdickinsonwildeIf you give me more information about the theme, I can try to debug it further, but so far unable to reproduce.
Comment #8
adam3145 commentedI am getting the same issue here is a link
http://master.doncampbell.actdev.ca/
Using bootstrap theme
Comment #9
adam3145 commentedComment #10
marcel tuchek commentedAny solutions? Desperately looking for a solution.
Comment #11
Robhern135 commentedSame issue here on multiple sites
Comment #12
neslee canil pintoCan you please provide step to reproduce this issue. Thanks.
Comment #13
neslee canil pintoComment #14
khaldoon_masud commentedTo reproduce:
Create two view blocks within the same view with view id "bock_1" and "block_10". drupalSettings.viewsSlideshowCycle will create two indexes drupalSettings.viewsSlideshowCycle["views_slideshow_cycle_view_name-block_1-2] and
drupalSettings.viewsSlideshowCycle["views_slideshow_cycle_view_name-block_10]
instead it should be
drupalSettings.viewsSlideshowCycle["views_slideshow_cycle_view_name-block_1] and
drupalSettings.viewsSlideshowCycle["views_slideshow_cycle_view_name-block_10]
This causes the below error:
It breaks the slideshow functionality.
Comment #15
khaldoon_masud commentedHere is the patch for #14