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

Swiper modules are not installed in SvelteKit #4767

Closed
6 tasks done
slava-viktorov opened this issue Jul 16, 2021 · 1 comment
Closed
6 tasks done

Swiper modules are not installed in SvelteKit #4767

slava-viktorov opened this issue Jul 16, 2021 · 1 comment
Labels

Comments

@slava-viktorov
Copy link
Contributor

slava-viktorov commented Jul 16, 2021

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/s/eager-archimedes-81jmb

Bug description

Additional Swiper modules are not installed when using SSR SvelteKit.

Probably, the Swiper component from "swiper/esm/svelte/swiper.svelte" and SwiperCore from "swiper/core" get different objects of the Swiper class (core-class.js).

  import Swiper from "swiper/esm/svelte/swiper.svelte";
  import SwiperSlide from "swiper/esm/svelte/swiper-slide.svelte";
  import "swiper/swiper.scss";
  import "swiper/components/pagination/pagination.scss";
  import SwiperCore, { Pagination } from "swiper";

  SwiperCore.use([Pagination]);
  
//on:swiper
   const onSwiper = (e) => {
      const [swiper] = e.detail;
      console.log(Object.keys(swiper.prototype.modules).join(', ')); // resize, observer - NOT INSTALL Pagination module
    }

Expected Behavior

No response

Actual Behavior

No response

Swiper version

6.7.5

Platform/Target and Browser Versions

Ubuntu 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
slava-viktorov added a commit to slava-viktorov/swiper that referenced this issue Jul 16, 2021
…lem with installing additional Swiper models when used in SvelteKit.

Fix nolimits4web#4767
@nolimits4web
Copy link
Owner

Duplicate #4705

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

No branches or pull requests

2 participants