biomejs/biome · error · io::Error

path {path:?} does not exists in memory filesystem

Error message

path {path:?} does not exists in memory filesystem

What it means

Error "path {path:?} does not exists in memory filesystem" thrown in biomejs/biome.

Source

Thrown at crates/biome_fs/src/fs/memory.rs:174

                    if options.create {
                        // If `create` is true, truncate the file
                        let entry = entry.into_mut();
                        *entry = Arc::new(Mutex::new(vec![]));
                        entry.lock_arc()
                    } else {
                        // This branch can only be reached if `create_new` was true,
                        // we should return an error if the file already exists
                        return Err(io::Error::new(
                            io::ErrorKind::AlreadyExists,
                            format!("path {path:?} already exists in memory filesystem"),
                        ));
                    }
                }
            }
        } else {
            let files = self.files.0.read();
            let entry = files.get(path).ok_or_else(|| {
                io::Error::new(
                    io::ErrorKind::NotFound,
                    format!("path {path:?} does not exists in memory filesystem"),
                )
            })?;

            entry.lock_arc()
        };

        if options.truncate {
            // Clear the buffer if the file was open with `truncate`
            inner.clear();
        }

        Ok(Box::new(MemoryFile {
            inner,
            can_read: options.read,
            can_write: options.write,
            version: 0,

View on GitHub (pinned to 405dedb0ff)

Solutions

  1. Create the file first (with `create` or `create_new`) before opening it without create options.
  2. Verify the path with `path_exists` before opening.

Example fix

let file = fs.open_with_options(path, OpenOptions::default().create(true).write(true))?;

When it happens

Trigger: Thrown at crates/biome_fs/src/fs/memory.rs:174 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/cbc70224dd6b10ae. Report an issue: GitHub.