budo
budo copied to clipboard
Squash fsevents errors (which are not errors on Linux)
On non-macOS systems, the following error is logged to the console on every rebuild:
Error: Cannot find module 'fsevents' from '…/node_modules/chokidar/lib'
fsevents is a macOS-only module and should not be causing errors on other platforms.
This PR squashes that specific error.
All tests passing on Node v10.14.2 under ~Ubuntu 18.10 (Pop!_OS 18.10)
Thanks! Can you provide a few more details? It seems like this is a bit of a hack, and will fail in some legitimate cases, e.g. if a user tries to require fsevents or some module that depends on it from within their client code. From what I understand, this method shouldn't even be called for non-client errors, so I'm not sure why this is even fixing your issue.
Are you getting this issue on a simple app like so:
// index.js
console.log("Hello, World");
# in terminal
budo index.js:bundle.js --live
Hey Matt, yeah I agree it’s hackish. Looks like the issue stems from Chokidar and has come up in various guises multiple times.
Can’t reproduce with your simple test.
I don’t mind if you close this. It will still come up in searches in case anyone else is affected.
Hmm odd, is there any small reproducible test case that emits the error for you? It sounds like you are requiring (in your browser/client code) some module that happens to require chokidar or fsevents.