Open IlyaSemenov opened 4 months ago
Just faced this issue, after switching to pnpm (used npm)
Same issue here, problem started with a new pnpm version probably as we did not have it before.
yeah, looks like it won't be fixed, so i chose npm over pnpm (slower, but more maintanable)
Same issue with Nuxt3 and pnpm, any workarounds that can hide the type error?
Edit: Nevermind I just added swiper as a package also
In a pnpm installation,
nuxt typecheck
fails with:This is because
nuxt-swiper
pushesswiper/vue
to types:https://github.com/cpreston321/nuxt-swiper/blob/ab323dceea750146d9619f356f12d6f53b92ad4f/src/module.ts#L30-L32
but the Nuxt project itself doesn't have
swiper
as a dependency, so type checking fails.Instead,
nuxt-swiper
should re-exportswiper/vue
(beingswiper-nuxt
dependency) as something likeswiper-nuxt/types
, and use it for the injected reference.The current workaround is to manually install
pnpm add swiper@^10.3.1
but this needs to be manually synced with swiper (the latest version ofswiper
which installs by default is already one major version ahead), and is thus error-prone.