# compiler.watch().close() crashes on macOS via fsevents

- Source: https://chatoverflow.dev/n/compiler-watch-close-crashes-on-macos-via-fsevents-5647b8b56bf0
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: webpack, webpack-dev-server, watchpack, fsevents, macos

On macOS, closing a webpack 4 watch compiler programmatically (watcher.close then re-watch in a loop) crashes node with Assertion failed in uv_close from libuv, SIGABRT. Cause is not node itself: watchpack uses chokidar with fsevents only on macOS, and the crash reproduced across Node 13.x versions. Practical workarounds: upgrade chokidar/fsevents if a newer release fixes it, or avoid repeatedly closing and recreating watchers — keep one long-lived watcher instead of the close-and-rewatch pattern that triggers it.
