{"record":{"id":"cc4a51cd97dee7f8","repo":"multica-ai/multica","slug":"package-all-platforms-cannot-be-combined-with","errorCode":null,"errorMessage":"[package] --all-platforms cannot be combined with explicit platform or arch flags","messagePattern":"\\[package\\] --all-platforms cannot be combined with explicit platform or arch flags","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/desktop/scripts/package.mjs","lineNumber":268,"sourceCode":"      continue;\n    }\n\n    sharedArgs.push(token);\n  }\n\n  return {\n    allPlatforms,\n    sharedArgs,\n    platformTargets,\n    requestedPlatforms: uniqueOrdered(requestedPlatforms),\n    requestedArchs: uniqueOrdered(requestedArchs),\n  };\n}\n\nexport function resolveBuildMatrix(parsed, platform = process.platform, arch = process.arch) {\n  if (parsed.allPlatforms) {\n    if (parsed.requestedPlatforms.length > 0 || parsed.requestedArchs.length > 0) {\n      throw new Error(\n        \"[package] --all-platforms cannot be combined with explicit platform or arch flags\",\n      );\n    }\n    if (platform !== \"darwin\") {\n      throw new Error(\n        `[package] --all-platforms is only supported on macOS hosts (current: ${platform})`,\n      );\n    }\n    return MAC_ALL_PLATFORM_TARGETS.map((target) => ({ ...target }));\n  }\n\n  const platforms =\n    parsed.requestedPlatforms.length > 0\n      ? parsed.requestedPlatforms\n      : [hostPlatformKey(platform)];\n  const archs =\n    parsed.requestedArchs.length > 0\n      ? parsed.requestedArchs","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/apps/desktop/scripts/package.mjs#L250-L286","documentation":"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.","triggerScenarios":"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.","commonSituations":"Scripts that layer default flags (package.json scripts adding --x64) colliding with an operator-supplied --all-platforms; local shell history reuse.","solutions":["Remove the explicit platform/arch flags and keep only --all-platforms.","Or drop --all-platforms and list the specific platforms/arches you want.","Check package.json scripts and CI YAML for hardcoded flags that get merged with CLI args, and clean up the duplication."],"exampleFix":"# before\nnode apps/desktop/scripts/package.mjs --all-platforms --x64\n\n# after\nnode apps/desktop/scripts/package.mjs --all-platforms","handlingStrategy":"validation","validationCode":"// Before spawning, assert the flag combination is legal\nif (argv.allPlatforms && (argv.platform?.length || argv.arch?.length)) {\n  console.error(\"--all-platforms cannot be combined with --platform/--arch flags\");\n  process.exit(2);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep --all-platforms as a standalone command; never bake default platform flags into npm scripts that also accept CLI args.","Document the exclusivity in the packaging README."],"tags":["build","packaging","desktop","cli-args","node"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}