{"record":{"id":"e9e42a0a63c06e70","repo":"stablyai/orca","slug":"electron-builds-are-not-available-on-platform-t-e9e42a","errorCode":null,"errorMessage":"Electron builds are not available on platform: ${targetPlatform}","messagePattern":"Electron builds are not available on platform: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/rebuild-native-deps.mjs","lineNumber":341,"sourceCode":"    return []\n  }\n}\n\nfunction getElectronPlatformPath() {\n  const targetPlatform =\n    process.env.ELECTRON_INSTALL_PLATFORM || process.env.npm_config_platform || rebuildPlatform\n  switch (targetPlatform) {\n    case 'mas':\n    case 'darwin':\n      return 'Electron.app/Contents/MacOS/Electron'\n    case 'freebsd':\n    case 'openbsd':\n    case 'linux':\n      return 'electron'\n    case 'win32':\n      return 'electron.exe'\n    default:\n      throw new Error(`Electron builds are not available on platform: ${targetPlatform}`)\n  }\n}\n\nfunction readCliOptions(args) {\n  const options = { force: false }\n  for (let index = 0; index < args.length; index += 1) {\n    const arg = args[index]\n    if (arg === '--force') {\n      options.force = true\n      continue\n    }\n    if (arg === '--platform') {\n      options.platform = readRequiredArgValue(args, (index += 1), '--platform')\n      continue\n    }\n    if (arg.startsWith('--platform=')) {\n      options.platform = readInlineArgValue(arg, '--platform')\n      continue","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/rebuild-native-deps.mjs#L323-L359","documentation":"Thrown by getElectronPlatformPath in config/scripts/rebuild-native-deps.mjs when the resolved target platform is not one of mas, darwin, freebsd, openbsd, linux, or win32. The function maps each supported platform to Electron's in-dist executable path; an unsupported platform has no Electron build to locate, so the switch's default branch refuses. targetPlatform is resolved from ELECTRON_INSTALL_PLATFORM, then npm_config_platform, then the rebuild-detected platform.","triggerScenarios":"Set ELECTRON_INSTALL_PLATFORM (or npm_config_platform) to an unsupported value like `aix`, `sunos`, `android`, or a typo such as `macos` (the correct value is `darwin`). The switch at lines 330-340 falls through to default and throws.","commonSituations":"A user copies a cross-compile snippet and sets `--platform macos` instead of `darwin`, or sets ELECTRON_INSTALL_PLATFORM to an experimental OS Electron does not ship for. The most common typo is `macos` vs `darwin`.","solutions":["Use a supported platform token: darwin, mas, linux, win32, freebsd, or openbsd.","If you meant macOS, use `darwin` (or `mas` for the Mac App Store build).","Unset ELECTRON_INSTALL_PLATFORM / npm_config_platform to let the script auto-detect."],"exampleFix":"// before\nELECTRON_INSTALL_PLATFORM=macos node config/scripts/rebuild-native-deps.mjs\n\n// after\nELECTRON_INSTALL_PLATFORM=darwin node config/scripts/rebuild-native-deps.mjs","handlingStrategy":"validation","validationCode":"const supported = new Set(['mas', 'darwin', 'freebsd', 'openbsd', 'linux', 'win32'])\nconst platform = process.env.ELECTRON_INSTALL_PLATFORM || process.env.npm_config_platform\nif (platform && !supported.has(platform)) {\n  throw new Error(`Unsupported platform '${platform}'. Use one of: ${[...supported].join(', ')}`)\n}","typeGuard":"const SUPPORTED_PLATFORMS = new Set(['mas', 'darwin', 'freebsd', 'openbsd', 'linux', 'win32'])\nfunction isElectronPlatform(value) {\n  return typeof value === 'string' && SUPPORTED_PLATFORMS.has(value)\n}","tryCatchPattern":null,"preventionTips":["Use `darwin` for macOS (not `macos`), `mas` for Mac App Store builds.","Unset ELECTRON_INSTALL_PLATFORM / npm_config_platform to auto-detect.","Validate the platform token against the supported set before rebuild."],"tags":["electron","platform","build","config","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}