DioxusLabs/dioxus · error

Package type '{invalid:?}' is not supported for bundle forma

Error message

Package type '{invalid:?}' is not supported for bundle format '{bundle}'.

What it means

Before bundling, dx bundle validates every requested package type against the chosen bundle format. The supported table is: MacOS -> MacOsBundle/Dmg/Updater, Linux -> Deb/Rpm/AppImage/Updater, Windows -> WindowsMsi/Nsis/Updater, Android -> Apk/Aab, Ios -> IosApp/Ipa, and Web/Server -> none at all. The first mismatching package type bails with this message.

Source

Thrown at packages/cli/src/cli/bundle.rs:257

                        | PackageType::AppImage
                        | PackageType::Updater
                ),
                BundleFormat::Windows => {
                    matches!(
                        package_type,
                        PackageType::WindowsMsi | PackageType::Nsis | PackageType::Updater
                    )
                }
                BundleFormat::Android => {
                    matches!(package_type, PackageType::Apk | PackageType::Aab)
                }
                BundleFormat::Ios => matches!(package_type, PackageType::IosApp | PackageType::Ipa),
                BundleFormat::Web | BundleFormat::Server => false,
            }
        };

        if let Some(invalid) = package_types.iter().find(|pt| !is_package_supported(pt)) {
            anyhow::bail!(
                "Package type '{invalid:?}' is not supported for bundle format '{bundle}'."
            );
        }

        Ok(())
    }
}

#[cfg(test)]
mod tests {
    use super::Bundle;
    use crate::{
        BuildArgs, BundleFormat, PackageType, Platform, cli::CommandWithPlatformOverrides,
    };

    #[test]
    fn bundle_formats_have_default_package_types() {
        assert_eq!(

View on GitHub (pinned to 393d190a80)

Solutions

  1. Use only matching pairs: macos -> app/dmg/updater, linux -> deb/rpm/appimage/updater, windows -> msi/nsis/updater, android -> apk/aab, ios -> ios-app/ipa
  2. Omit --package-type entirely and let default_package_types pick the format's defaults (e.g. Ios -> Ipa, Android -> Aab)
  3. For Web or Server bundles, drop --package-type completely; no package type is supported
  4. Run dx bundle once per target platform instead of combining types across platforms

Example fix

# before (mismatched pair)
dx bundle --format ios --package-type apk

# after (matching pair)
dx bundle --format android --package-type apk
Defensive patterns

Strategy: validation

Validate before calling

#!/usr/bin/env bash
# Reject invalid format/package pairs before invoking dx bundle
case "$FORMAT/$PKG" in
  macos/app|macos/dmg|macos/updater|linux/deb|linux/rpm|linux/appimage|linux/updater|windows/msi|windows/nsis|windows/updater|android/apk|android/aab|ios/ios-app|ios/ipa) ;;
  *) echo "unsupported pair: $FORMAT/$PKG"; exit 1 ;;
esac

Prevention

When it happens

Trigger: Passing --package-type values that do not belong to the selected bundle format, e.g. apk with a macOS bundle, or any package type with format web or server, for which the match arms return false unconditionally.

Common situations: Copying a CI bundle command from another platform's docs; mixing package types from multiple platforms in one command; assuming web bundles accept a package type.

Related errors


AI-assisted analysis of DioxusLabs/dioxus@393d190a80 (2026-08-16). Data as JSON: /api/errors/c9a55fdcc0a8505f. Report an issue: GitHub.