{"record":{"id":"74be5a1f1bfa15d3","repo":"DioxusLabs/dioxus","slug":"esbuild-not-found-on-path-and-downloads-are-disabl","errorCode":null,"errorMessage":"esbuild not found on PATH and downloads are disabled","messagePattern":"esbuild not found on PATH and downloads are disabled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/esbuild.rs","lineNumber":22,"sourceCode":"//! previous SWC Rust library dependencies. The standalone Go binary is\n//! downloaded from the npm registry and cached locally.\n\nuse crate::{CliSettings, Workspace};\nuse anyhow::{Context, anyhow};\nuse std::path::PathBuf;\n\n/// Pinned esbuild version.\nconst ESBUILD_VERSION: &str = \"0.27.3\";\n\npub(crate) struct Esbuild;\n\nimpl Esbuild {\n    /// Ensure the esbuild binary is available, downloading if needed.\n    /// Returns the path to the binary.\n    pub(crate) async fn get_or_install() -> anyhow::Result<PathBuf> {\n        if CliSettings::prefer_no_downloads() {\n            which::which(\"esbuild\")\n                .map_err(|_| anyhow!(\"esbuild not found on PATH and downloads are disabled\"))\n        } else {\n            let path = Self::installed_bin_path();\n            if !path.exists() {\n                Self::install_from_npm().await?;\n            }\n            Ok(path)\n        }\n    }\n\n    /// Return the esbuild binary path if it's already been installed or is on PATH.\n    /// This is a sync check intended for use after `verify_tooling` has been called.\n    pub(crate) fn path_if_installed() -> Option<PathBuf> {\n        let path = Self::installed_bin_path();\n        if path.exists() {\n            Some(path)\n        } else {\n            which::which(\"esbuild\").ok()\n        }","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/esbuild.rs#L4-L40","documentation":"Failure of Esbuild::get_or_install when downloads are disabled (CliSettings::prefer_no_downloads, e.g. offline/CI mode) and no esbuild executable is discoverable via which::which on PATH. The toolchain cannot transform JS/JSX without either the system binary or the downloaded one.","triggerScenarios":"Thrown at packages/cli/src/esbuild.rs:22 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["esbuild is not on PATH and downloads are disabled. Install esbuild manually or enable automatic downloads."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}