cpreston321 / nuxt-swiper

Swiper.js for Nuxt
https://www.npmjs.com/package/nuxt-swiper
MIT License
208 stars 9 forks source link

nuxt-swiper is not support ssr:false, Is it a bug? #123

Open lizy0329-biubiubiu opened 2 months ago

lizy0329-biubiubiu commented 2 months ago

when I set ssr: false in nuxt.config.ts, CI show tips:

[error] Nuxt Build Error: [vite]: Rollup failed to resolve import "swiper/css" from "virtual:nuxt:/builds/mfex/ssr-source/goodtime/.nuxt/css.mjs".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

util I import swiper/vue instead of nuxt-swiper

cpreston321 commented 2 months ago

@lizy0329-biubiubiu please trying using the swiper elements branch on v2.

Docs: https://github.com/cpreston321/nuxt-swiper/tree/feat/elements?tab=readme-ov-file#nuxt-swiper

Install: https://github.com/cpreston321/nuxt-swiper/pull/109

Please let me know if that helps. v1 will soon be deprecated.

STY1997 commented 1 week ago

@lizy0329-biubiubiu please trying using the swiper elements branch on v2.

Docs: https://github.com/cpreston321/nuxt-swiper/tree/feat/elements?tab=readme-ov-file#nuxt-swiper

Install: #109

Please let me know if that helps. v1 will soon be deprecated.

Hi, does "v1 will soon be deprecated" mean that we have another v2.x.x nuxt-swiper which supports swiper element (webComponents)? Shall I use this library or I might wait you to publish the v2 version?

Currently, I am struggling in setting up the swiper element with Nuxt3... :(