biomejs/biome · error

watcher created

Error message

watcher created

What it means

Error "watcher created" thrown in biomejs/biome.

Source

Thrown at crates/biome_cli/src/runner/impls/watchers/default.rs:21

use crate::runner::diagnostics::WatcherDiagnostic;
use crate::runner::watcher::{Watcher, WatcherEvent};
use biome_diagnostics::{Error, NotifyError};
use camino::Utf8PathBuf;
use notify::event::{CreateKind, ModifyKind, RemoveKind};
use notify::{Event, EventKind, RecursiveMode, Result, recommended_watcher};
use tracing::warn;

pub(crate) struct DefaultWatcher {
    rx: Receiver<Result<Event>>,
    watcher: Box<dyn notify::Watcher>,
}

impl DefaultWatcher {
    pub fn new() -> Self {
        let (tx, rx) = channel();
        Self {
            rx,
            watcher: Box::new(recommended_watcher(tx).expect("watcher created")),
        }
    }
}

impl Watcher for DefaultWatcher {
    fn watch(&mut self, paths: Vec<Utf8PathBuf>) {
        let mut watched_paths = self.watcher.paths_mut();

        for path in paths {
            if let Err(e) = watched_paths.add(path.as_std_path(), RecursiveMode::Recursive) {
                warn!("Failed to watch path {}: {}", path, e);
            }
        }
        if let Err(e) = watched_paths.commit() {
            warn!("Failed to commit watched paths: {}", e);
        }
    }

View on GitHub (pinned to 405dedb0ff)

Solutions

  1. Ensure the watched paths exist before creating the watcher.
  2. Check inotify/fs-event limits if watcher creation fails repeatedly.

Example fix

// Raise the inotify watch limit: sysctl fs.inotify.max_user_watches

When it happens

Trigger: Thrown at crates/biome_cli/src/runner/impls/watchers/default.rs:21 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of biomejs/biome@405dedb0ff (2026-08-20). Data as JSON: /api/errors/549e09347d95ff84. Report an issue: GitHub.