-
-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improper handling of broken symlinks, causes UnhandledPromiseRejectionWarning #955
Comments
Looks like chokidar/lib/nodefs-handler.js Line 607 in 7c79e45
|
same problem here |
pull requests are welcome |
fwiw, this breaks create-react-app's webpack server hard, because it treats these warnings as errors and crashes the server The error looks like this:
Here's the stack trace to the call that throws the error.
I'm happy to send a PR, but is there some reason this isn't as simple as wrapping the unhandled await call in a |
try adding try catch, adding the failing test, and seeing if that breaks any other tests |
When watching a directory with
followSymlinks
off, if the directory contains links for which the target does not exist, chokidar blows up with:This is due to calling
fsrealpath
on the link, which fails (since the link target does not exist) here:chokidar/lib/nodefs-handler.js
Line 416 in 7c79e45
Note the node.js documentation for
fs.realpath
:(it does not specify what happens when the link target does not exist, but as reality shows it throws
ENOENT
...)Perhaps using the
fs.readlink
function would be more appropriate there.The text was updated successfully, but these errors were encountered: