lydell/elm-watch

source-directories with big ancestor directory → file watcher error

Opened this issue · 2 comments

With a source-directories field containing both src and a distant unpublished library

"source-directories": [
    "src",
    "../../../some-libraries/elm-midi/src"
]

elm-watch throws the following error and terminates its process

 21:14:20 Compilation finished in 2.26 s.
-- WATCHER ERROR ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The file watcher encountered an error, which means that it cannot continue.
elm-watch is powered by its file watcher, so I have to exit at this point.

See if this is something you can solve by maybe removing some problematic files
or something!

This is the error message I got:

ENOSPC: System limit for number of file watchers reached, watch '/home/lue/Desktop/some-libraries/some-unrelated-library/.git/objects/87/05073607de7d25a6bcadb660cf7e1b8bfdd447'

My uneducated guess is that this function:

const watchRoot = longestCommonAncestorPath(paths);

watches all the library files and many more within the parent directory of some-libraries and this app's instead of only the relevant ones from only the specified directories.

Current workaround is moving the unpublished library code to the app's directory.

Anyway, much, much love for building elm-watch! 🌈⃤🦋

lydell commented

What an excellent bug report! Thank you! 💙

ℹ️ This should be fixed in the beta version (npm install elm-watch@beta), but I haven’t tested it.