{"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":"anyhow::Error","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/393d190a801ccb441d41923e232289b4f8a5c669/packages/cli/src/esbuild.rs#L4-L40","documentation":"The CLI uses a pinned esbuild (ESBUILD_VERSION 0.27.3) for JS/TS asset processing and auto-downloads it on demand — unless download-free mode is enabled via CliSettings::prefer_no_downloads(). In that mode get_or_install only probes PATH with which::which; if no esbuild binary is found, it fails immediately with this message and never hits the network.","triggerScenarios":"Building (dx build/serve/bundle) with JS/TS assets on a machine where downloads are disabled (offline/air-gapped policy, DX no-download setting) and esbuild is not installed or not on PATH.","commonSituations":"Hermetic CI images that forbid network access; corporate proxies blocking registry.npmjs.org; local dev with the no-downloads preference toggled on but the toolchain never installed.","solutions":["Install esbuild globally and make sure it is on PATH: npm install -g esbuild@0.27.3 (or brew install esbuild)","Re-enable downloads (unset the no-downloads CLI/DX setting) so dx fetches its pinned copy automatically","Pin the same version as the CLI (0.27.3) so behavior matches the bundled toolchain"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Pre-check the toolchain when downloads are disabled\ncommand -v esbuild >/dev/null || npm install -g esbuild@0.27.3","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bake esbuild 0.27.3 into offline CI images","Verify with `which esbuild` before any no-download build","Pin the same version as the CLI to avoid behavioral drift"],"tags":["cli","esbuild","offline","toolchain"],"backgroundTag":null,"analyzedSha":"393d190a801ccb441d41923e232289b4f8a5c669","analyzedAt":"2026-08-16T11:27:45.815Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}