Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
📝 WalkthroughWalkthroughThe changes enable polling-based file watching in chokidar configurations across two modules to mitigate EMFILE errors on macOS when running Serverless Framework dev mode with large projects. After chokidar v4 removed fsevents support, polling is explicitly enabled to ensure reliable file change detection. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
eahefnawy
left a comment
There was a problem hiding this comment.
Looks good. But what's the difference between the engine code/change the the plugin code/change?
Summary
usePolling: true) in chokidar file watchers to prevent "EMFILE: too many open files" errors on macOSContext
In v4.31.0, we upgraded chokidar from v3.6.0 to v4.0.3. Chokidar v4 removed bundled fsevents support (native macOS file watching), causing the file watcher to fall back to
fs.watchwhich creates one file descriptor per file/directory. On larger projects, this can exhaust the OS file descriptor limit, resulting inEMFILE: too many open fileserrors duringserverless dev.Enabling polling mode (
usePolling: true) switches chokidar to usefs.watchFilewhich avoids this issue by using a different file watching mechanism that doesn't exhaust file descriptors.Fixes #13268
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.