Bug Report: EMFILE error (too many open files) in development mode with flowbite-react/plugin/vite
🔍 Bug Description The flowbite-react/plugin/vite plugin causes an EMFILE: too many open files error when running Vite in development mode, but works fine in production builds.
Environment OS: macOS (MacBook Air) Node.js: v22.17.1 Package Manager: npm Vite: Latest version flowbite-react: Latest version with new auto-generated class-list.json feature
Steps to Reproduce Configure Vite with the flowbite-react plugin: plugins: [ Run development server: Error occurs immediately ❌Error Output ✅ Current Workaround
The only working solution is to conditionally load the plugin only in production: This allows: ✅ Development server to run without errors ✅ Production builds to include flowbite-react functionality ❌ Loss of flowbite-react features during development
Attempted Solutions That Don't Work Increasing system file limits: Vite watch configuration: Disabling plugin features:
Analysis The issue seems related to the new auto-generation feature of class-list.json in the .flowbite-react directory and maybe other files observed The plugin appears to:
Monitor too many files simultaneously Create recursive file watchers Possibly watch the class-list.json file it's generating, creating an infinite loop Conflict with Vite's native file watching system
Expected Behavior The plugin should work in both development and production modes File watching should be optimized to avoid hitting system limits The plugin should not interfere with Vite's native HMR system
Possible Fixes Implement debounced file watching Limit the number of files being watched simultaneously Exclude auto-generated files from the watcher Add configuration options to disable intensive watching in development Use a more efficient file watching strategy
Project Context Laravel + Vite + React application Large codebase with multiple plugins Standard macOS development environment
Can u please specify exactly on what flowbite-react version this is reproducible? There has been some file watcher improvements in [email protected] release.
"flowbite-react": "^0.12.2",
I can't seem to reproduce this, even with the same stack Laravel + Vite + React 🤔
Is it possible beacause my project has many files? I’m sure that is a problem caused by flowbite plugin, beacause when i remove it from “plugins” of vite the dev mode works well
How i can help you to reproduce the error?
It's definitely from the plugin, I just want to be able to reproduce it so I can test, debug and improve it.
It's definitely from the plugin, I just want to be able to reproduce it so I can test, debug and improve it.
maybe i can give you the project where this happens?
If it's not confidential, sure why not
Does it still happen with the latest release?