Join the Webstudio community

Updated 3 months ago

the issue with swiper on canvas

At a glance

The community member is having trouble using Swiper on Canvas, as their background turns white when they run the script. The first comment suggests checking the marketplace for a Swiper template and using <script type="module"> on the custom script. The comment also mentions an error in the console about redeclaring a constant. The second comment suggests using "client only". The third comment indicates that the community member tried the above steps, but they didn't work, so they used the Swiper bundle script, which is type='module', and it worked.

Hi, I'm having trouble using Swiper on Canvas. My background turns white when I run the script.
Image
Attachment
image.png
J
W
3 comments
  1. see the marketplace for a swiper template.
  2. you need to use <script type="module"> on your custom script. if you check the console, you'll see an error right now that you are redeclaring a const that already exists
try both of those and see if youre have the issue still
also use client only
Thanks for the suggestions. I tried the above steps but it didn't work so I used the Swiper bundle script which is type='module' and it worked.
Attachment
image.png
Add a reply
Sign up and join the conversation on Discord