Closed peterpeterparker closed 6 years ago
it's actually Swiper (used in ion-slides), not our code :(
cc @mhartington any idea?
@peterpeterparker got a sample project or test case for this?
@mhartington I'll observe the situation during the next days and will see if I found a way of providing such info/samples
I just faced the error again and I ask my self if the error "just" happens in a particular state where the slider is added to the dom but not fully loaded
For example the following code might generate the problem time to time
isNotFirstSlide(): boolean {
return this.slider && this.slider.nativeElement && this.slider.nativeElement.getActiveIndex() > 0;
}
As workaround I think I would be able to do something like
isNotFirstSlide(): boolean {
try {
return this.slider && this.slider.nativeElement && this.slider.nativeElement.getActiveIndex() > 0;
} catch (err) {
return false;
}
}
will try this and will update the issue
I didn't face the error the last three days so I'm guessing that my above explanation and workaround aren't that wrong, therefore I close this issue
If you land on the error and you are not willing to use try/catch, @rapropos provided another possible option on the Ionic forum https://forum.ionicframework.com/t/ionic-4-slides/138717/3?u=reedrichards which might works too respectively
slides: Slides;
@ViewChild(Slides) set slidesvc(slides) {
this.slides = slides;
}
btw. 10 days later, didn't encounter the problem anymore, so definitely all good
👍
Ionic Info @ionic/angular: "4.0.0-beta.2"
Describe the Bug The following error poped up in my Chrome debug console a couple of times today. I don't know effectively when unfortunately
where
d6ubnyaf.js:5
isremoveClass:function(e){for(var t=e.split(" "),i=0;i<t.length;i+=1)for(var s=0;s<this.length;s+=1)void 0!==this[s].classList&&this[s].classList.remove(t[i]);return this},hasClass:function(e){return!!this[0]&&this[0].classList.contains(e)},
which according the header is an Ionic file
Expected Behavior No such error ;)