TypeError: Cannot read properties of undefined (reading 'activeIndex') - swiper v11; angular v18 #7587
Unanswered
gugafreitas
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm encountering a
TypeError: Cannot read properties of undefined (reading 'activeIndex')
error in my Angular component unit test.The issue arises when trying to access swiper.activeIndex in the component.
I think the problem is that i initialize a variable as a HTMLElement, and then it is not recognized as a swiper container.
Could the solution be to mock up the swiper? If so, how?
Beta Was this translation helpful? Give feedback.
All reactions