-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'toString' of null if data-history attribute is missing when using Thumbs+Gallery+Loop #4384
Comments
Example? Demo? Core, Vue, React, Svelte, Angular? |
Good Question, actually, I do not know I used the Version from cdn. https://unpkg.com/swiper/swiper-bundle.min.js Actually, this bug only applies to Thumbs Gallery Loop Hope this helps While debugging I found that line 91 inside history.js was always called, which has to fail as I did not have data-history attributes set. After setting these attributes the history was updated, which for my understanding of history:false should not happen. |
Does not work Thumbs Gallery. https://swiperjs.com/demos/300-thumbs-gallery.html |
We are also seeing this issue when linking our Thumb slider with our main slider. It is completely broken and also broken on the swiper.js demo site. Is there any plan to fix this or set back the version to before this bug was introduced? |
I'm still seeing the issue - https://swiperjs.com/demos#thumbs-gallery (here is a demo, regarding the "missing demo" tag) |
Hi,
it seems like history navigation is now enabled and cannot be disabled, therefore if the data-history attribute is missing a Javascript error is thrown.
Manually setting the history option to false didn't do anything.
Uncaught TypeError: Cannot read property 'toString' of null
at Object.slugify (history.js:79)
at t.scrollToSlide (history.js:91)
at t.init (history.js:18)
at t.init (history.js:123)
at events-emitter.js:95
at Array.forEach ()
at events-emitter.js:94
at Array.forEach ()
at t.emit (events-emitter.js:87)
at t.r.init (core-class.js:499)
Downgrading to 6.4.15 worked for me. As I did not check version 6.5.0, I am not sure in which of these two Versions this bug was introduced.
Hope this helps to find the Bug.
Maybe something like
history.js(91)
const slideHistory = History.slugify(slide.attr('data-history') || '');
will fix that error.
The text was updated successfully, but these errors were encountered: