multica-ai/multica · warning

[package] --all-platforms cannot be combined with explicit p

Error message

[package] --all-platforms cannot be combined with explicit platform or arch flags

What it means

Thrown by resolveBuildMatrix in apps/desktop/scripts/package.mjs when --all-platforms is combined with explicit --win/--mac/--linux platform flags or --x64/--arm64 arch flags. --all-platforms is an exclusive macro that expands to the fixed MAC_ALL_PLATFORM_TARGETS matrix, so per-target flags are contradictory and rejected up front rather than silently ignored.

Source

Thrown at apps/desktop/scripts/package.mjs:268

      continue;
    }

    sharedArgs.push(token);
  }

  return {
    allPlatforms,
    sharedArgs,
    platformTargets,
    requestedPlatforms: uniqueOrdered(requestedPlatforms),
    requestedArchs: uniqueOrdered(requestedArchs),
  };
}

export function resolveBuildMatrix(parsed, platform = process.platform, arch = process.arch) {
  if (parsed.allPlatforms) {
    if (parsed.requestedPlatforms.length > 0 || parsed.requestedArchs.length > 0) {
      throw new Error(
        "[package] --all-platforms cannot be combined with explicit platform or arch flags",
      );
    }
    if (platform !== "darwin") {
      throw new Error(
        `[package] --all-platforms is only supported on macOS hosts (current: ${platform})`,
      );
    }
    return MAC_ALL_PLATFORM_TARGETS.map((target) => ({ ...target }));
  }

  const platforms =
    parsed.requestedPlatforms.length > 0
      ? parsed.requestedPlatforms
      : [hostPlatformKey(platform)];
  const archs =
    parsed.requestedArchs.length > 0
      ? parsed.requestedArchs

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Remove the explicit platform/arch flags and keep only --all-platforms.
  2. Or drop --all-platforms and list the specific platforms/arches you want.
  3. Check package.json scripts and CI YAML for hardcoded flags that get merged with CLI args, and clean up the duplication.

Example fix

# before
node apps/desktop/scripts/package.mjs --all-platforms --x64

# after
node apps/desktop/scripts/package.mjs --all-platforms
Defensive patterns

Strategy: validation

Validate before calling

// Before spawning, assert the flag combination is legal
if (argv.allPlatforms && (argv.platform?.length || argv.arch?.length)) {
  console.error("--all-platforms cannot be combined with --platform/--arch flags");
  process.exit(2);
}

Prevention

When it happens

Trigger: Running e.g. `node scripts/package.mjs --all-platforms --x64` or `--all-platforms --mac`; passing flags through an npm script that already includes platform defaults; CI config copying a per-platform invocation and appending --all-platforms.

Common situations: Scripts that layer default flags (package.json scripts adding --x64) colliding with an operator-supplied --all-platforms; local shell history reuse.

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/cc4a51cd97dee7f8. Report an issue: GitHub.