{"record":{"id":"601e056f8274fb07","repo":"dmtrKovalenko/fff","slug":"unsupported-architecture-arch","errorCode":null,"errorMessage":"Unsupported architecture: ${arch}","messagePattern":"Unsupported architecture: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fff-bun/src/platform.ts","lineNumber":66,"sourceCode":"    return \"unknown-linux-musl\";\n  }\n  return \"unknown-linux-gnu\";\n}\n\n/**\n * Normalize architecture name to Rust target format\n */\nfunction normalizeArch(arch: string): string {\n  switch (arch) {\n    case \"x64\":\n    case \"amd64\":\n      return \"x86_64\";\n    case \"arm64\":\n      return \"aarch64\";\n    case \"arm\":\n      return \"arm\";\n    default:\n      throw new Error(`Unsupported architecture: ${arch}`);\n  }\n}\n\n/**\n * Get the library file extension for the current platform\n */\nexport function getLibExtension(): \"dylib\" | \"so\" | \"dll\" {\n  switch (process.platform) {\n    case \"darwin\":\n      return \"dylib\";\n    case \"win32\":\n      return \"dll\";\n    default:\n      return \"so\";\n  }\n}\n\n/**","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/dmtrKovalenko/fff/blob/7f8537e70f0ea1210f9acbbfc4640141105cdc78/packages/fff-bun/src/platform.ts#L48-L84","documentation":"normalizeArch() converts process.arch to the Rust target arch segment and only accepts x64/amd64, arm64, and arm. Any other process.arch value makes getTriple() throw, so triple-based lookups (npm package name, library filename) cannot proceed.","triggerScenarios":"Calling getTriple() (via archName/normalizeArch) on hardware or an emulator where process.arch returns something like 'ia32', 'mips', 'ppc64', 's390x', 'riscv64', or 'loong64'.","commonSituations":"Running on older 32-bit x86 machines, big-iron or embedded Linux (s390x/ppc64), RISC-V boards, or under emulation layers that report an unusual arch; also broken test mocks of process.arch.","solutions":["Run on a supported architecture: x86_64 (x64/amd64), aarch64 (arm64), or arm.","For other architectures, build the Rust crate from source (`cargo build --release -p fff-c`) and place the binary where the loader looks, bypassing npm-package resolution.","Fix test mocks to set process.arch to 'x64' or 'arm64'."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const OK = new Set(['x64','amd64','arm64','arm']);\nif (!OK.has(process.arch)) throw new Error(`unsupported arch ${process.arch}`);","typeGuard":"function isSupportedArch(a: string): a is 'x64'|'amd64'|'arm64'|'arm' {\n  return ['x64','amd64','arm64','arm'].includes(a);\n}","tryCatchPattern":null,"preventionTips":["Verify arch support (x86_64/aarch64/arm) before deployment.","Prefer 64-bit runtimes on 64-bit hardware (avoid ia32 Node).","Mock process.arch realistically in tests."],"tags":["architecture","unsupported-platform","bun"],"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"}