nolimits4web / swiper

Most modern mobile touch slider with hardware accelerated transitions
https://swiperjs.com
MIT License
39.74k stars 9.75k forks source link

[vite-node] [ERR_INVALID_URL_SCHEME] /node_modules/swiper/core/core.js #6090

Closed waysagency closed 2 years ago

waysagency commented 2 years ago

Check that this is really a bug

Reproduction link

/

Bug description

image

Expected Behavior

Importing modules

Actual Behavior

I try to use the latest swiper (V8.4.2) with nuxt 3 (V3.0.0-rc.11). When I try to import a module (e.g. Navigation), the error will pop up.

<template>
  <swiper
    :modules="[Navigation, A11y]"
    slides-per-view="1"
    :space-between="20"
    :breakpoints="{
      640: {
        slidesPerView: 2,
      },
      1280: {
        slidesPerView: 3,
      },
    }"
  >
    <swiper-slide v-for="index in 8" :key="index"> Slide {{ index }} </swiper-slide>
  </swiper>
</template>

<script setup>
// import Swiper core and required modules
import { Navigation, A11y } from "swiper";

// Import Swiper Vue.js components
import { Swiper, SwiperSlide } from "swiper/vue";

// Import Swiper styles
import "swiper/css";
import "swiper/css/navigation";
</script>
{
  "private": true,
  "scripts": {
    "dev": "npx nuxi dev -o --https --ssl-cert localhost.pem --ssl-key localhost-key.pem",
    "build": "nuxt build",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare"
  },
  "devDependencies": {
    "@nuxt/image-edge": "^1.0.0-27719579.87dcdf2",
    "@nuxtjs/tailwindcss": "^5.3.3",
    "@tailwindcss/forms": "^0.5.3",
    "nuxt": "3.0.0-rc.11",
    "sass": "^1.55.0",
    "sass-loader": "^13.0.2"
  },
  "dependencies": {
    "@storyblok/nuxt": "^4.3.0",
    "swiper": "^8.3.1"
  }
}

Swiper version

8.4.2

Platform/Target and Browser Versions

Windows, Chrome 105.0.5195.127

Validations

Would you like to open a PR for this bug?

nolimits4web commented 2 years ago

You should open this issue on Nuxt i think

wzc520pyfm commented 1 year ago

you can refer to this issue with nuxt, hope to help https://github.com/nuxt/nuxt.js/issues/14125