DioxusLabs/dioxus · error

No esbuild binary available for this platform

Error message

No esbuild binary available for this platform

What it means

Raised by Esbuild::install_from_npm when no platform-specific npm package (tar.gz archive) matching the current OS/architecture can be identified in the esbuild npm registry listing, so the binary cannot be downloaded and cached in the tools directory.

Solutions

  1. No esbuild binary exists for this platform. Install esbuild manually.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/cli/src/esbuild.rs:60 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23). Data as JSON: /api/errors/cfb6f36e0f6e5996. Report an issue: GitHub.

Appendix: source

Thrown at packages/cli/src/esbuild.rs:60

    /// The path where we cache the esbuild binary.
    fn installed_bin_path() -> PathBuf {
        let dir = Workspace::tools_dir().join(format!("esbuild-{ESBUILD_VERSION}"));
        let name = if cfg!(windows) {
            "esbuild.exe"
        } else {
            "esbuild"
        };
        dir.join(name)
    }

    /// Download esbuild from the npm registry and extract the binary.
    ///
    /// esbuild publishes platform-specific packages to npm as tar.gz archives.
    /// Each archive contains `package/bin/esbuild[.exe]`.
    async fn install_from_npm() -> anyhow::Result<()> {
        let platform = Self::npm_platform_package()
            .ok_or_else(|| anyhow!("No esbuild binary available for this platform"))?;

        let registry = std::env::var("NPM_CONFIG_REGISTRY")
            .or_else(|_| std::env::var("npm_config_registry"))
            .unwrap_or_else(|_| "https://registry.npmjs.org".to_string());
        let registry = registry.trim_end_matches('/');
        let url = format!("{registry}/@esbuild/{platform}/-/{platform}-{ESBUILD_VERSION}.tgz");

        tracing::info!("Installing esbuild v{ESBUILD_VERSION} from {url}...");

        let bytes = reqwest::get(&url)
            .await
            .with_context(|| format!("Failed to download esbuild from {url}"))?
            .bytes()
            .await
            .context("Failed to read esbuild download response")?;

        // Extract `package/bin/esbuild[.exe]` from the tar.gz
        let binary_data = Self::extract_binary_from_tgz(&bytes)?;

View on GitHub (pinned to 24f6a829df)