budo icon indicating copy to clipboard operation
budo copied to clipboard

Squash fsevents errors (which are not errors on Linux)

Open aral opened this issue 6 years ago • 4 comments

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.

aral avatar Jan 15 '19 12:01 aral

All tests passing on Node v10.14.2 under ~Ubuntu 18.10 (Pop!_OS 18.10)

aral avatar Jan 15 '19 16:01 aral

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

mattdesl avatar Jan 16 '19 10:01 mattdesl

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.

aral avatar Jan 16 '19 14:01 aral

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.

mattdesl avatar Jan 16 '19 14:01 mattdesl