{"record":{"id":"3b37580a65245bd9","repo":"dmtrKovalenko/fff","slug":"unsupported-platform-platform-3b3758","errorCode":null,"errorMessage":"Unsupported platform: ${platform}","messagePattern":"Unsupported platform: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fff-node/src/platform.ts","lineNumber":24,"sourceCode":"\n/**\n * Get the platform triple (e.g., \"x86_64-unknown-linux-gnu\")\n */\nexport function getTriple(): string {\n  const platform = process.platform;\n  const arch = process.arch;\n\n  let osName: string;\n  if (platform === \"darwin\") {\n    osName = \"apple-darwin\";\n  } else if (platform === \"android\") {\n    osName = \"linux-android\";\n  } else if (platform === \"linux\") {\n    osName = detectLinuxLibc();\n  } else if (platform === \"win32\") {\n    osName = \"pc-windows-msvc\";\n  } else {\n    throw new Error(`Unsupported platform: ${platform}`);\n  }\n\n  const archName = normalizeArch(arch);\n  return `${archName}-${osName}`;\n}\n\n/**\n * Detect whether we're on musl or glibc Linux\n */\nfunction detectLinuxLibc(): string {\n  let output = \"\";\n  try {\n    output = execSync(\"ldd --version 2>&1\", {\n      encoding: \"utf-8\",\n      timeout: 5000,\n    });\n  } catch (e: unknown) {\n    const err = e as { stdout?: string | Buffer; stderr?: string | Buffer };","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/dmtrKovalenko/fff/blob/7f8537e70f0ea1210f9acbbfc4640141105cdc78/packages/fff-node/src/platform.ts#L6-L42","documentation":"The fff-node getTriple() recognizes only darwin, android, linux, and win32 as process.platform values. Any other platform string makes triple resolution impossible, so the package cannot pick a native library filename or npm package and throws.","triggerScenarios":"Invoking getTriple() (directly or via triple/getNpmPackageName) on platforms like freebsd, openbsd, aix, sunos — or in environments/tests where process.platform is mocked to an invalid value.","commonSituations":"Running on BSD servers or AIX, SSR/browser-ish environments where process.platform is undefined, and unit tests stubbing process.platform incorrectly.","solutions":["Run on a supported platform (macOS, Linux, Windows, Android).","For unsupported OSes, compile the Rust lib yourself and avoid npm-package resolution paths.","Correct test stubs to use one of the four supported platform strings."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!['darwin','android','linux','win32'].includes(process.platform)) throw new Error(`unsupported platform ${process.platform}`);","typeGuard":"function isSupportedPlatform(p: NodeJS.Platform): boolean {\n  return ['darwin','android','linux','win32'].includes(p);\n}","tryCatchPattern":null,"preventionTips":["Guard platform before binary resolution on non-mainstream OSes.","Use accurate process.platform mocks in tests.","Document supported platforms for your deployment targets."],"tags":["platform","unsupported-platform","node"],"backgroundTag":"unsupported-platform","analyzedSha":"7f8537e70f0ea1210f9acbbfc4640141105cdc78","analyzedAt":"2026-09-10T07:26:53.407Z","contentChangedAt":"2026-09-10T07:26:53.407Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}