biomejs/biome · error

valid format document

Error message

valid format document

What it means

Error "valid format document" thrown in biomejs/biome.

Source

Thrown at crates/biome_service/src/configuration.rs:525

    if VERSION == "0.0.0" {
        let schema_path = Utf8Path::new("./node_modules/@biomejs/biome/configuration_schema.json");
        let options = OpenOptions::default().read(true);
        if fs.open_with_options(schema_path, options).is_ok() {
            configuration.schema = Some(schema_path.to_string().into());
        }
    } else {
        configuration.schema =
            Some(format!("https://biomejs.dev/schemas/{VERSION}/schema.json").into());
    }

    let contents = serde_json::to_string_pretty(&configuration)
        .map_err(|_| BiomeDiagnostic::new_serialization_error())?;

    let parsed = parse_json(&contents, JsonParserOptions::default());
    let formatted =
        biome_json_formatter::format_node(JsonFormatOptions::default(), &parsed.syntax())?
            .print()
            .expect("valid format document");

    config_file
        .set_content(formatted.as_code().as_bytes())
        .map_err(|_| WorkspaceError::cant_read_file(format!("{path}")))?;

    Ok(())
}

/// Returns the rules applied to a specific [Path], given the [Settings]
pub fn to_analyzer_rules(settings: &Settings, path: &Utf8Path) -> AnalyzerRules {
    let override_indices = settings.matching_override_indices(path);
    to_analyzer_rules_by_indices(settings, &override_indices)
}

pub(crate) fn to_analyzer_rules_by_indices(
    settings: &Settings,
    override_indices: &[usize],
) -> AnalyzerRules {

View on GitHub (pinned to 0fca643d22)

Solutions

  1. This is an internal assertion in configuration formatting; report it with the configuration file that triggered it.
  2. Ensure the formatter produced a valid document before printing it.

Example fix

// Report at https://github.com/biomejs/biome/issues with the configuration used

When it happens

Trigger: Thrown at crates/biome_service/src/configuration.rs:524 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of biomejs/biome@0fca643d22 (2026-08-20). Data as JSON: /api/errors/3b0967f3494b12c1. Report an issue: GitHub.