{"record":{"id":"cfb6f36e0f6e5996","repo":"DioxusLabs/dioxus","slug":"no-esbuild-binary-available-for-this-platform","errorCode":null,"errorMessage":"No esbuild binary available for this platform","messagePattern":"No esbuild binary available for this platform","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/esbuild.rs","lineNumber":60,"sourceCode":"\n    /// The path where we cache the esbuild binary.\n    fn installed_bin_path() -> PathBuf {\n        let dir = Workspace::tools_dir().join(format!(\"esbuild-{ESBUILD_VERSION}\"));\n        let name = if cfg!(windows) {\n            \"esbuild.exe\"\n        } else {\n            \"esbuild\"\n        };\n        dir.join(name)\n    }\n\n    /// Download esbuild from the npm registry and extract the binary.\n    ///\n    /// esbuild publishes platform-specific packages to npm as tar.gz archives.\n    /// Each archive contains `package/bin/esbuild[.exe]`.\n    async fn install_from_npm() -> anyhow::Result<()> {\n        let platform = Self::npm_platform_package()\n            .ok_or_else(|| anyhow!(\"No esbuild binary available for this platform\"))?;\n\n        let registry = std::env::var(\"NPM_CONFIG_REGISTRY\")\n            .or_else(|_| std::env::var(\"npm_config_registry\"))\n            .unwrap_or_else(|_| \"https://registry.npmjs.org\".to_string());\n        let registry = registry.trim_end_matches('/');\n        let url = format!(\"{registry}/@esbuild/{platform}/-/{platform}-{ESBUILD_VERSION}.tgz\");\n\n        tracing::info!(\"Installing esbuild v{ESBUILD_VERSION} from {url}...\");\n\n        let bytes = reqwest::get(&url)\n            .await\n            .with_context(|| format!(\"Failed to download esbuild from {url}\"))?\n            .bytes()\n            .await\n            .context(\"Failed to read esbuild download response\")?;\n\n        // Extract `package/bin/esbuild[.exe]` from the tar.gz\n        let binary_data = Self::extract_binary_from_tgz(&bytes)?;","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/393d190a801ccb441d41923e232289b4f8a5c669/packages/cli/src/esbuild.rs#L42-L78","documentation":"When downloads are allowed, dx fetches esbuild from npm by mapping the host platform to an @esbuild/<platform> package (darwin-arm64, darwin-x64, linux-x64, linux-arm64, win32-x64, win32-arm64). npm_platform_package returns None for anything else, and install_from_npm bails immediately with this error before any request is made.","triggerScenarios":"Running a build that needs esbuild on an OS/arch combination outside the supported npm package list — e.g. linux-riscv64, freebsd, i686 windows, or unusual musl targets.","commonSituations":"Building on niche architectures or alternative operating systems; exotic container images (Alpine on uncommon archs); CI runners on platforms esbuild does not publish prebuilds for.","solutions":["Install esbuild manually and put it on PATH (distro package or build from source) so the npm download path is skipped","Do the build inside a container for a supported arch (x64 or arm64) and reuse the artifacts","Pair this with download-free mode so dx uses your PATH esbuild instead of attempting the fetch","File an upstream issue requesting support for your platform"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"# Supported @esbuild platforms: darwin-arm64 darwin-x64 linux-x64 linux-arm64 win32-x64 win32-arm64\n# Pre-flight in CI:\ncase \"$(uname -s)/$(uname -m)\" in\n  Darwin/arm64|Darwin/x86_64|Linux/x86_64|Linux/aarch64) echo ok ;;\n  *) echo 'unsupported for esbuild download — preinstall on PATH' ;;\nesac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build on x64/arm64 across the three major OSes to stay inside the supported matrix","Preinstall esbuild on unusual platforms and run dx in no-download mode","Containerize exotic-arch builds against a supported arch and copy artifacts out"],"tags":["cli","esbuild","platform-support","install"],"backgroundTag":null,"analyzedSha":"393d190a801ccb441d41923e232289b4f8a5c669","analyzedAt":"2026-08-16T11:27:45.815Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}