Skip to content
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

TypeError : Cannot read properties of undefined (reading 'autoplay') #5244

Closed
5 of 6 tasks
muneebrana414 opened this issue Nov 30, 2021 · 7 comments
Closed
5 of 6 tasks

Comments

@muneebrana414
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

its personal

Bug description

Screenshot 2021-11-30 200022

Expected Behavior

No response

Actual Behavior

No response

Swiper version

7.3.1

Platform/Target and Browser Versions

chrome

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@github-actions
Copy link

Hello @muneebrana414. Please provide a online reproduction by codesandbox or a minimal GitHub repository. You can fork one of our demos in codesandbox to get start. Issues labeled by missing demo will be closed if no activities in 3 days.

@muneebrana414
Copy link
Author

Here I, apply swiper

import { Swiper, SwiperSlide } from "swiper/react";
import "swiper/css";
import SwiperCore, { Autoplay } from 'swiper'
SwiperCore.use([ Autoplay ]);

export default function SideSwipe(){
return(


<Swiper slidesPerView={5} centeredSlides={false} slidesPerGroup={1} spaceBetween={1} loop={true} direction={'vertical'}
// autoplay={true} autoplay={{
// 'delay':2000,
// 'disableOnInteraction': false
// }}
className="mySwiper mt-2" style={{height:700}}>











);
}

@muneebrana414
Copy link
Author

@nolimits4web i post my code

@github-actions
Copy link

github-actions bot commented Dec 2, 2021

Hello @muneebrana414. Please provide a online reproduction by codesandbox or a minimal GitHub repository. You can fork one of our demos in codesandbox to get start. Issues labeled by missing demo will be closed if no activities in 3 days.

@github-actions github-actions bot closed this as completed Dec 6, 2021
@geekftz
Copy link

geekftz commented Dec 7, 2022

i got the same problem, so why close this problem, or give me some advice to handle it?

@nickycdk
Copy link

@muneebrana414 @hackftz @nolimits4web - Did any of you ever find a solution to this? I'm experiencing the same, primarily when the component is unmounted

@krystiangryczon
Copy link

In my case I had this line of code:

SwiperCore.use([Controller, Autoplay]);

and later in code used swiper like this:

         <Swiper
          autoHeight
          onSwiper={setSwiper}
          controller={{ control: swiper }}
          onActiveIndexChange={(s) => setActiveIndex(s.activeIndex)}
          modules={[EffectFade, Autoplay]}
          effect="fade"
          autoplay={{
            delay: 5000,
            disableOnInteraction: false,
          }}
        >

once I deleted Autoplay from modules inside the Swiper tag - it doesn't error anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants