{"record":{"id":"145255c081128642","repo":"parcel-bundler/parcel","slug":"unsupported-architecture-on-macos-arch","errorCode":null,"errorMessage":"Unsupported architecture on macOS: ${arch}","messagePattern":"Unsupported architecture on macOS: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/core/rust/index.js","lineNumber":159,"sourceCode":"          loadError = e;\n        }\n        break;\n      case 'arm64':\n        localFileExisted = existsSync(\n          join(__dirname, 'parcel-node-bindings.darwin-arm64.node'),\n        );\n        try {\n          if (localFileExisted) {\n            nativeBinding = require('./parcel-node-bindings.darwin-arm64.node');\n          } else {\n            nativeBinding = require('@parcel/rust-darwin-arm64');\n          }\n        } catch (e) {\n          loadError = e;\n        }\n        break;\n      default:\n        throw new Error(`Unsupported architecture on macOS: ${arch}`);\n    }\n    break;\n  case 'freebsd':\n    if (arch !== 'x64') {\n      throw new Error(`Unsupported architecture on FreeBSD: ${arch}`);\n    }\n    localFileExisted = existsSync(\n      join(__dirname, 'parcel-node-bindings.freebsd-x64.node'),\n    );\n    try {\n      if (localFileExisted) {\n        nativeBinding = require('./parcel-node-bindings.freebsd-x64.node');\n      } else {\n        nativeBinding = require('@parcel/rust-freebsd-x64');\n      }\n    } catch (e) {\n      loadError = e;\n    }","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/parcel-bundler/parcel/blob/59484858a1a0bcbb71f74088956bb437a2db6505/packages/core/rust/index.js#L141-L177","documentation":"Thrown by @parcel/rust's binding loader on macOS (darwin) when process.arch is neither 'x64' nor 'arm64'. The darwin branch tries a universal binary then arch-specific packages; the default rejects anything else so the build fails fast instead of loading a mismatched binding.","triggerScenarios":"Running Parcel on macOS where process.arch reports an unexpected value — most commonly an Intel-on-ARM Rosetta mismatch, an exotic arch string, or a corrupted Node install reporting the wrong arch.","commonSituations":"After a macOS upgrade or migration between Intel/Apple Silicon; running Node under Rosetta with arch misreported; using an experimental Node build (e.g. for a new arch); running via a thin compatibility shim.","solutions":["Reinstall the native Node.js build for your actual CPU (`node -p process.arch` should be 'x64' or 'arm64').","If running under Rosetta, force the native arch: `arch -arch arm64 node ...` on Apple Silicon.","Use the darwin-universal prebuilt by ensuring @parcel/rust-darwin-universal is installed.","Reinstall Parcel (`npm ci`) so optionalDependencies for darwin resolve correctly."],"exampleFix":"# before: Node launched under Rosetta on Apple Silicon\n$ node -p process.arch   # 'x64' but expecting arm64? actually works; error is for OTHER arches\n\n# after: force native arch\n$ arch -arch arm64 node -p process.arch\n'arm64'","handlingStrategy":"validation","validationCode":"import { platform, arch } from 'process';\nif (platform === 'darwin' && arch !== 'x64' && arch !== 'arm64') {\n  throw new Error(`Unsupported macOS arch ${arch}; reinstall Node for x64/arm64.`);\n}","typeGuard":"function isSupportedDarwinArch(a: string): boolean {\n  return a === 'x64' || a === 'arm64';\n}","tryCatchPattern":null,"preventionTips":["On Apple Silicon, run Node natively (arch arm64), not under Rosetta, unless intended.","Use the darwin-universal prebuilt to cover both arches.","Reinstall Parcel after switching Node arch so optional deps re-resolve."],"tags":["native-binding","macos","architecture","parcel-rust"],"backgroundTag":null,"analyzedSha":"59484858a1a0bcbb71f74088956bb437a2db6505","analyzedAt":"2026-08-13T04:06:35.925Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}