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

Either watchpack or chokidar is locking files in Windows #446

Closed
DullReferenceException opened this issue Mar 5, 2016 · 3 comments
Closed

Comments

@DullReferenceException
Copy link

I'm indirectly using chokidar through watchpack. File watching appears to be causing files to be locked in Windows. For example, if I'm running the dev webpack server and do an npm install or git rebase, their attempts to update or delete files sometimes receive access permission errors.

My issue was originally filed with watchpack, but it was closed because file watching is implemented through chokidar. But I'm not sure whether the bug is in chokidar or in the way it is being used. Here's how watchpack is using chokidar.

https://github.com/webpack/watchpack/blob/master/lib/DirectoryWatcher.js#L48

Is it possible that chokidar is opening files/directories in an overly-restrictive manner? As far as I can tell, OS X developers on my team do not have this same issue.

@paulmillr
Copy link
Owner

Is it possible that chokidar is opening files/directories in an overly-restrictive manner

That's unlikely. I think that's watchpack-related.

@Elephant-Vessel
Copy link

This is probably why: #320?

@es128
Copy link
Contributor

es128 commented Mar 7, 2016

Is it possible that chokidar is opening files/directories in an overly-restrictive manner?

No, not in terms of anything chokidar has control over. Try using chokidar in isolation (without watchpack) to see if you can reproduce the issue. You could start with the example.js script in the repo. If it does occur just from watching with chokidar, then the issue is somewhere in the realm of node.js core fs.watch() or the Windows file system itself. You might be able to work around it with the usePolling: true option. Either way, there's nothing we can do in chokidar to have an impact afaik, so I'll be closing the issue. But PR welcome if anyone can propose a solution.

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

4 participants