astral-sh/ruff · error · Error

Vendored file not found: {path}: {err}

Error message

Vendored file not found: {path}: {err}

What it means

A wasm-bindgen Error from ty's getVendoredFile binding: constructing or resolving the vendored path failed, with the underlying error appended. Vendored files (e.g. bundled typeshed) are addressed by relative paths, and the given path could not be resolved to one.

Source

Thrown at crates/ty_wasm/src/lib.rs:819

                range: Range::from_file_range(
                    &self.db,
                    target.file_range(),
                    self.position_encoding,
                ),
                kind: target.kind().into(),
            })
            .collect())
    }

    /// Gets a file handle for a vendored file by its path.
    /// This allows vendored files to participate in LSP features like hover, completions, etc.
    #[wasm_bindgen(js_name = "getVendoredFile")]
    pub fn get_vendored_file(&self, path: &str) -> Result<FileHandle, Error> {
        let vendored_path = VendoredPath::new(path);

        // Try to get the vendored file as a File
        let file = vendored_path_to_file(&self.db, vendored_path)
            .map_err(|err| Error::new(&format!("Vendored file not found: {path}: {err}")))?;

        Ok(FileHandle {
            file,
            path: vendored_path.to_path_buf().into(),
        })
    }
}

pub(crate) fn into_error<E: std::fmt::Display>(err: E) -> Error {
    Error::new(&err.to_string())
}

fn map_targets_to_links(
    db: &dyn Db,
    targets: RangedValue<NavigationTargets>,
    source: &SourceText,
    index: &LineIndex,
    position_encoding: PositionEncoding,

View on GitHub (pinned to 26f38c119c)

Solutions

  1. Use a valid vendored path relative to the vendored root
  2. Inspect the appended underlying error for the concrete cause
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/ty_wasm/src/lib.rs:819 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of astral-sh/ruff@26f38c119c (2026-09-05). Data as JSON: /api/errors/4a72182c8c273f66. Report an issue: GitHub.