Skip to content
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

Occasionally crashes with Atom's temporary files. #238

Open
ghost opened this issue Jun 15, 2016 · 4 comments
Open

Occasionally crashes with Atom's temporary files. #238

ghost opened this issue Jun 15, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Jun 15, 2016

Seems to occasionally crash on a temporary files created by the "Backup before saving" option in Atom. Getting the following error:

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, stat '/Users/keironlowe/Development/removed/removed/removed/expressionengine/templates/stash/partials/blocks/views/navigation.html~'

Disabling the option fixes the error for me but it's not ideal. Issue also opened on the Atom repo.

@UltCombo
Copy link
Collaborator

UltCombo commented Jun 15, 2016

I think this is a problem in Chokidar and/or gulp-watch; it is missing some error handling at some point(s).

You see, once the watcher fires an event, we add a delay before reading the file contents. It is possible that the file no longer exists by then. It should be possible to reproduce the issue even without a delay, as external file system changes (e.g. deleting files) may happen at any time during script execution.

Not sure what's the best approach, maybe we can catch the error and don't fire the callback for added/changed files when they have been removed before we could read them.

@UltCombo
Copy link
Collaborator

By the way, I believe you can temporarily workaround the issue by ignoring the backup files, e.g.:

watch(['files/**/*', '!files/**/*~'])

@UltCombo
Copy link
Collaborator

Actually, I believe you should always ignore the backup files—you most likely don't want them to be processed by gulp. So, my comment above is the correct fix for your specific case, but we can keep this issue open to improve our error handling.

@UltCombo
Copy link
Collaborator

UltCombo commented Jul 4, 2016

#242 has been merged into this issue.
If anyone is interested in contributing with a patch, here's some useful info: #242 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant