{"record":{"id":"6454843e4c4f8694","repo":"mihomo-party-org/clash-party","slug":"unsupported-platform-platform-arch","errorCode":null,"errorMessage":"Unsupported platform: ${platform}-${arch}","messagePattern":"Unsupported platform: (.+?)-(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/native/sysproxy/index.js","lineNumber":58,"sourceCode":"          ? 'sysproxy.win32-ia32-msvc-win7.node'\n          : 'sysproxy.win32-ia32-msvc.node'\n      if (arch === 'arm64') return 'sysproxy.win32-arm64-msvc.node'\n      break\n    case 'darwin':\n      if (arch === 'x64') return 'sysproxy.darwin-x64.node'\n      if (arch === 'arm64') return 'sysproxy.darwin-arm64.node'\n      break\n    case 'linux':\n      if (isMusl()) {\n        if (arch === 'x64') return 'sysproxy.linux-x64-musl.node'\n        if (arch === 'arm64') return 'sysproxy.linux-arm64-musl.node'\n      } else {\n        if (arch === 'x64') return 'sysproxy.linux-x64-gnu.node'\n        if (arch === 'arm64') return 'sysproxy.linux-arm64-gnu.node'\n      }\n      break\n  }\n  throw new Error(`Unsupported platform: ${platform}-${arch}`)\n}\n\nfunction getResourcesPath() {\n  // 开发环境：优先使用 process.cwd()\n  const cwd = process.cwd()\n  if (existsSync(join(cwd, 'extra', 'sidecar'))) {\n    return cwd\n  }\n  // Electron 打包后的路径\n  if (process.resourcesPath && existsSync(join(process.resourcesPath, 'sidecar'))) {\n    return process.resourcesPath\n  }\n  // 备选：使用 app.getAppPath() (Electron 特有)\n  try {\n    const { app } = require('electron')\n    const appPath = app.getAppPath()\n    if (existsSync(join(appPath, 'extra', 'sidecar'))) {\n      return appPath","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/mihomo-party-org/clash-party/blob/911e090537acdf7c50bee1c3aebecc2ef119a8b5/src/native/sysproxy/index.js#L40-L76","documentation":"getBindingName() maps the current process.platform/process.arch to a prebuilt native .node filename for the sysproxy module. When the running platform/arch combination has no prebuilt binary in the lookup table, it throws 'Unsupported platform: <platform>-<arch>'. This is a build/packaging-time coverage error: the native module simply was not compiled or shipped for this OS+CPU pair.","triggerScenarios":"Launching the app (module init calls loadBinding()->bindingName()->getBindingName()) on a platform not covered by the switch, e.g. win32-arm64, freebsd-x64, darwin-x86 (32-bit), linux on musl-only distros if only gnu builds ship, or any exotic arch like ppc64/loong64.","commonSituations":"Running the Electron app on Windows ARM or Linux ARM with a glibc/musl mismatch; CI matrix testing on an unsupported OS; users on Alpine/musl where the '-gnu' suffix binary cannot load; running under a newly released platform before native CI artifacts exist.","solutions":["Check the actual process.platform and process.arch in the error text and confirm whether a prebuilt sysproxy binary exists for that pair in extra/sidecar or the packaged resources.","If the platform should be supported, add a case to getBindingName() returning the correct '<name>.<platform>-<arch>-<libc>.node' filename and build the binary via the native build pipeline.","If musl/Alpine is the issue, install gcompat or switch to a glibc-based distro, or produce a '-musl' variant of the binding.","As a last resort, run the app on a supported platform (linux-x64, linux-arm64, darwin-x64/arm64, win32-x64)."],"exampleFix":"// before\nthrow new Error(`Unsupported platform: ${platform}-${arch}`)\n// after\nif (platform === 'linux' && arch === 'arm64' && isMusl()) return 'sysproxy.linux-arm64-musl.node'\nthrow new Error(`Unsupported platform: ${platform}-${arch}`)","handlingStrategy":"validation","validationCode":"const SUPPORTED = [['darwin','x64'],['darwin','arm64'],['win32','x64'],['linux','x64'],['linux','arm64']]\nif (!SUPPORTED.some(([p, a]) => process.platform === p && process.arch === a)) {\n  console.error(`Unsupported platform: ${process.platform}-${process.arch}`)\n}","typeGuard":null,"tryCatchPattern":"try {\n  const sysproxy = require('src/native/sysproxy')\n  sysproxy.triggerManualProxy(true, host, port)\n} catch (e) {\n  if (e.message.startsWith('Unsupported platform:')) {\n    // degrade gracefully: disable system-proxy features\n  }\n}","preventionTips":["Maintain an explicit support matrix of platform/arch pairs and check it before enabling sysproxy features in the UI.","Add CI jobs that import the module on each supported platform to catch missing native builds.","Log process.platform/process.arch in telemetry to see which unsupported combos users actually hit.","Ship fallback behavior (feature disabled + message) instead of crashing at module load."],"tags":["native-module","platform-compatibility","electron"],"backgroundTag":"unsupported-platform-arch","analyzedSha":"911e090537acdf7c50bee1c3aebecc2ef119a8b5","analyzedAt":"2026-08-30T13:00:49.174Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}