{"record":{"id":"81bca5142bb91726","repo":"can1357/oh-my-pi","slug":"unsupported-platform-ctx-platformtag-nsupporte","errorCode":null,"errorMessage":"Unsupported platform: ${ctx.platformTag}\\nSupported platforms: ${SUPPORTED_PLATFORMS.join(\", \")}\\nIf you need support for this platform, please open an issue.","messagePattern":"Unsupported platform: (.+?)\\\\nSupported platforms: (.+?)\\\\nIf you need support for this platform, please open an issue\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/natives/native/loader-state.js","lineNumber":880,"sourceCode":"\tconst runtimeCandidates = prepended.length > 0 ? [...prepended, ...ctx.candidates] : ctx.candidates;\n\n\tfor (const candidate of runtimeCandidates) {\n\t\ttry {\n\t\t\tstartupMarker(`native:require:${path.basename(candidate)}`);\n\t\t\tconst bindings = require_(candidate);\n\t\t\tvalidateLoadedBindings(ctx, bindings, candidate);\n\t\t\tinstallNativeTokioRuntime(bindings);\n\t        cleanupStaleNativeVersions({ nativesDir: ctx.nativesDir, currentVersion: ctx.packageVersion });\n\t\t\tstartupMarker(\"native:loadNative:done\");\n\t\t\treturn bindings;\n\t\t} catch (err) {\n\t\t\tconst message = err instanceof Error ? err.message : String(err);\n\t\t\terrors.push(`${candidate}: ${message}`);\n\t\t}\n\t}\n\n\tif (!SUPPORTED_PLATFORMS.includes(ctx.platformTag)) {\n\t\tthrow new Error(\n\t\t\t`Unsupported platform: ${ctx.platformTag}\\n` +\n\t\t\t\t`Supported platforms: ${SUPPORTED_PLATFORMS.join(\", \")}\\n` +\n\t\t\t\t\"If you need support for this platform, please open an issue.\",\n\t\t);\n\t}\n\tconst details = errors.map(error => `- ${error}`).join(\"\\n\");\n\tthrow new Error(\n\t\t`Failed to load pi_natives native addon for ${ctx.addonLabel}.\\n\\nTried:\\n${details}\\n\\n${buildHelpMessage(ctx)}`,\n\t);\n}\n","sourceCodeStart":862,"sourceCodeEnd":891,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/natives/native/loader-state.js#L862-L891","documentation":"The native loader only ships prebuilt addons for a fixed list of platform/arch tags (SUPPORTED_PLATFORMS). When the runtime's platform tag (os-arch combination, e.g. linux-arm64 or freebsd-x64) is not in that list, loading cannot possibly succeed, so the loader throws immediately with the list of supported platforms instead of accumulating per-candidate errors.","triggerScenarios":"loadNative() runs on a machine whose ctx.platformTag (derived from process.platform/process.arch) is not in SUPPORTED_PLATFORMS — e.g. linux-armv7, freebsd, openbsd, android, sunos, or win32-ia32.","commonSituations":"Running omp on a Raspberry Pi / ARM SBC, BSD variants, unsupported Linux architectures (armv6/armv7, riscv), Alpine musl variants when only glibc targets ship, or cross-compiled containers with an unexpected arch.","solutions":["Run on one of the listed supported platforms (check the Supported platforms list in the message).","Use an x64 or arm64 Linux/macOS build or Windows x64; for ARM SBCs use a 64-bit OS image.","If your platform must be supported, open an issue as the message suggests (or build the Rust addon yourself via the pi-natives crate).","Check for container/CI images that override the architecture (e.g. running amd64 image emulation — use a native-arch image)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const SUPPORTED_PLATFORMS = [\"darwin-x64\", \"darwin-arm64\", \"linux-x64\", \"linux-arm64\", \"win32-x64\"]; // as shipped\nconst platformTag = `${process.platform}-${process.arch}`;\nif (!SUPPORTED_PLATFORMS.includes(platformTag)) {\n  // degrade gracefully: disable native-accelerated features or abort early with a clear message\n  console.error(`Unsupported platform: ${platformTag}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  loadNative(ctx);\n} catch (err) {\n  if (err.message.startsWith(\"Unsupported platform:\")) {\n    // fall back to non-native (JS) implementations or install-time check\n  } else throw err;\n}","preventionTips":["Check process.platform/process.arch against the supported list before installing or launching.","Pin CI/dev containers to supported architectures (x64/arm64 glibc images).","On ARM SBCs use 64-bit OS images; avoid emulated (qemu amd64) runtimes.","Check the package's supported-platforms docs before deploying to unusual environments."],"tags":["platform","unsupported-platform","native-addon","environment"],"backgroundTag":"unsupported-platform","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}