Fork me on GitHub
#reagent
<
2021-11-02
>
Mitul Shah14:11:09

I’m trying to use https://swiperjs.com/react but the import just wont work. it gives me an error that the package is not found though it’s there? ["swiper/react" :refer [Swiper SwiperSlide]

p-himik14:11:07

Do you see the directory swiper in your node_modules? And does it have the react directory in there?

Mitul Shah14:11:14

if i just do [`"swiper" :refer..`] it knows the directory is there but obv not what i want

p-himik14:11:48

In package.json you can see an array under the key "exports". There, you can see this entry: "./react": "./react/swiper-react.js", So, I'd try adding /swiper-react to that initial import.

p-himik14:11:57

(at least shadow-cljs adds .js automatically)

Mitul Shah14:11:56

works thank u!

👍 1