FormidableLabs / nuka-carousel

Small, fast, and accessibility-first React carousel library with an easily customizable UI and behavior to fit your brand and site.
https://commerce.nearform.com/open-source/nuka-carousel
Other
3.07k stars 595 forks source link

Vite gives error while running an application having nuka-carousel #892

Closed arunabhg closed 2 years ago

arunabhg commented 2 years ago

Bugs and Questions

Vite gives an error while running an application having nuka-carousel

Describe Your Environment

Describe the Problem

When running my vite React project by using npm run dev, I'm getting the following error-

X [ERROR] [plugin vite:dep-scan] Failed to resolve entry for package "nuka-carousel". The package 
may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for 
package "nuka-carousel". The package may have incorrect main/module/exports specified in its package.json.

Below is the nuka-carousel's package.json entry -

image

Additional Information

On inspection, I found that the module entry is incorrect. The error stops after I manually change the data for the "module" key to "es-v5/index.js" in nuka-carousel's package.json and re-run my application.

image

But if I do an npm install later, the error reappears as the package.json gets reset.

ValGeorgiev commented 2 years ago

Hey @arunabhg, thanks for raising this with us. I make the changes and publish it in v5.0.14 . Please let me know if you still reproduce the issue

arunabhg commented 2 years ago

The issue seems to be taken care of in the latest version. Running fine now. Happy to contribute