Closed 0x44454c closed 3 years ago
Native file system watchers tend to be temperamental in a way that is difficult for us to debug, especially on Windows. We can probably surface a better error message here, but it's unlikely to be something we can fix ourselves. You may want to file an issue against Dart's watcher package. I'm not able to replicate this error on my own Windows machine, so you should include some information about your machine.
You should be able to work around this by adding the --poll
flag, which bypasses the OS's native watcher and just polls the watched files periodically.
This error should be handled correctly already—it should be surfaced as a Future
exception by the await for
in _Watcher.watch
:
Which is awaited in watch()
:
Which is awaited in main()
:
https://github.com/sass/dart-sass/blob/0f68d7a5115082df93049f6df78f3f33a9fb424b/bin/sass.dart#L57
Which has backup error-handling code that should have handled this exception:
The fact that it didn't suggests that something is broken in dart:io
's native watcher code. I don't think there's much more we can do to mitigate this.
Above is the exception occurring whenever sass is used for more than 10 seconds in watch mode. It is getting stopped after 10 seconds while watching.