chore: move module watcher from chokidar to fs#4240
Conversation
This prevents EMFILE errors after chokidar version update
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughBoth ChangesMigrate extra module watcher from chokidar to fs.watch
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
launcher/main.js (1)
287-313:⚠️ Potential issue | 🟠 MajorNice catch on the
fs.FSWatchermigration — the.close().catch(...)calls need a fix to avoid runtime errors.Line 287 switches
watchertofs.FSWatcher, but lines 448, 720, 1000, and 1067 still callwatcher.close().catch(...). SinceFSWatcher.close()is synchronous and returnsvoid(not a Promise), chaining.catch()will throw aTypeErrorat runtime. Line 299 also awaits the close, which is semantically incorrect (though it won't error in this case).The suggested fix with a dedicated
closeWatcher()helper is solid and would clean this up nicely — we'd handle the sync close with try/catch in one place and call it consistently everywhere.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 70fcc8ed-a609-4795-b874-23d9544a7acc
📒 Files selected for processing (2)
launcher/main.jstools/dev.mts
|
There are quite a few documented caveats for this api, some could maybe be a problem? In particular I am wondering about:
I wonder what that means for WSL, as that is a virtual machine these days, or if anyone is using something like devcontainers on macos |
|
Good points / questions. I'll need to do some reading on those use cases, as I'm not entirely sure / have not tested outside of a Mac dev environment. |
This prevents EMFILE errors (same situation as) #4068, that remerged after chokidar version update.
Summary by CodeRabbit
node_modules, and debouncing per-module reloads to reduce noisy updates.