banthagroup / fslightbox-vue

Basic version of Fullscreen Lightbox for Vue.js. Website: https://fslightbox.com/vue
MIT License
41 stars 3 forks source link

Can't import from "fslightbox-vue/v3" using Vite in production mode #67

Open lewebsimple opened 2 years ago

lewebsimple commented 2 years ago

I was having a strange probleme where FsLighbox would only work in development mode using Vite to build the project.

It turns out importing from fslightbox-vue/v3 was returning the component on the default property, so I had to do this:

import FsLightboxV3 from "fslightbox-vue/v3";
const FsLightbox = FsLightboxV3.default || FsLightboxV3;

Any idea ?

ceciogit commented 1 year ago

Same here...

captainscorch commented 1 year ago

Thanks for providing a solution to this! I had the same issue.

andymark-by commented 1 year ago

I had the same. @lewebsimple Thx for your solution. I thought that it can be fixed by optimizeDeps, but it doesn't work for me :(