igordanchenko / yet-another-react-lightbox

Modern React lightbox component
https://yet-another-react-lightbox.com
MIT License
853 stars 40 forks source link

Module level directives cause errors when bundled, "use client" #166

Closed parth391 closed 1 year ago

parth391 commented 1 year ago

Describe the bug

vite v4.4.7 building for production... node_modules/yet-another-react-lightbox/dist/index.js (1:0) Module level directives cause errors when bundled, "use client" in "node_modules/yet-another-react-lightbox/dist/index.js" was ignored.

Expected behavior

Error should not come.

How to reproduce

Version details

react: v18.2.0 vite: v4.4.7 yet-another-react-lightbox: 3.12.0

Error is coming while running npm run build.

Screenshots / Logs

No response

Additional context

No response

igordanchenko commented 1 year ago

First off, this is not an error, but merely a warning. You are seeing this warning because you are using an outdated version of @vitejs/plugin-react. Updating your @vitejs/plugin-react to v4 will make this warning go away.