mihomo-party-org/clash-party · error · Error
Unsupported platform: ${platform}-${arch}
Error message
Unsupported platform: ${platform}-${arch} What it means
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.
Source
Thrown at src/native/sysproxy/index.js:58
? 'sysproxy.win32-ia32-msvc-win7.node'
: 'sysproxy.win32-ia32-msvc.node'
if (arch === 'arm64') return 'sysproxy.win32-arm64-msvc.node'
break
case 'darwin':
if (arch === 'x64') return 'sysproxy.darwin-x64.node'
if (arch === 'arm64') return 'sysproxy.darwin-arm64.node'
break
case 'linux':
if (isMusl()) {
if (arch === 'x64') return 'sysproxy.linux-x64-musl.node'
if (arch === 'arm64') return 'sysproxy.linux-arm64-musl.node'
} else {
if (arch === 'x64') return 'sysproxy.linux-x64-gnu.node'
if (arch === 'arm64') return 'sysproxy.linux-arm64-gnu.node'
}
break
}
throw new Error(`Unsupported platform: ${platform}-${arch}`)
}
function getResourcesPath() {
// 开发环境:优先使用 process.cwd()
const cwd = process.cwd()
if (existsSync(join(cwd, 'extra', 'sidecar'))) {
return cwd
}
// Electron 打包后的路径
if (process.resourcesPath && existsSync(join(process.resourcesPath, 'sidecar'))) {
return process.resourcesPath
}
// 备选:使用 app.getAppPath() (Electron 特有)
try {
const { app } = require('electron')
const appPath = app.getAppPath()
if (existsSync(join(appPath, 'extra', 'sidecar'))) {
return appPathView on GitHub (pinned to 911e090537)
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).
Example fix
// before
throw new Error(`Unsupported platform: ${platform}-${arch}`)
// after
if (platform === 'linux' && arch === 'arm64' && isMusl()) return 'sysproxy.linux-arm64-musl.node'
throw new Error(`Unsupported platform: ${platform}-${arch}`) Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED = [['darwin','x64'],['darwin','arm64'],['win32','x64'],['linux','x64'],['linux','arm64']]
if (!SUPPORTED.some(([p, a]) => process.platform === p && process.arch === a)) {
console.error(`Unsupported platform: ${process.platform}-${process.arch}`)
} Try / catch
try {
const sysproxy = require('src/native/sysproxy')
sysproxy.triggerManualProxy(true, host, port)
} catch (e) {
if (e.message.startsWith('Unsupported platform:')) {
// degrade gracefully: disable system-proxy features
}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
AI-assisted analysis of mihomo-party-org/clash-party@911e090537 (2026-08-30).
Data as JSON: /api/errors/6454843e4c4f8694.
Report an issue: GitHub.