parcel-bundler/parcel · critical · Error

Unsupported architecture on macOS: ${arch}

Error message

Unsupported architecture on macOS: ${arch}

What it means

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.

Source

Thrown at packages/core/rust/index.js:159

          loadError = e;
        }
        break;
      case 'arm64':
        localFileExisted = existsSync(
          join(__dirname, 'parcel-node-bindings.darwin-arm64.node'),
        );
        try {
          if (localFileExisted) {
            nativeBinding = require('./parcel-node-bindings.darwin-arm64.node');
          } else {
            nativeBinding = require('@parcel/rust-darwin-arm64');
          }
        } catch (e) {
          loadError = e;
        }
        break;
      default:
        throw new Error(`Unsupported architecture on macOS: ${arch}`);
    }
    break;
  case 'freebsd':
    if (arch !== 'x64') {
      throw new Error(`Unsupported architecture on FreeBSD: ${arch}`);
    }
    localFileExisted = existsSync(
      join(__dirname, 'parcel-node-bindings.freebsd-x64.node'),
    );
    try {
      if (localFileExisted) {
        nativeBinding = require('./parcel-node-bindings.freebsd-x64.node');
      } else {
        nativeBinding = require('@parcel/rust-freebsd-x64');
      }
    } catch (e) {
      loadError = e;
    }

View on GitHub (pinned to 59484858a1)

Solutions

  1. Reinstall the native Node.js build for your actual CPU (`node -p process.arch` should be 'x64' or 'arm64').
  2. If running under Rosetta, force the native arch: `arch -arch arm64 node ...` on Apple Silicon.
  3. Use the darwin-universal prebuilt by ensuring @parcel/rust-darwin-universal is installed.
  4. Reinstall Parcel (`npm ci`) so optionalDependencies for darwin resolve correctly.

Example fix

# before: Node launched under Rosetta on Apple Silicon
$ node -p process.arch   # 'x64' but expecting arm64? actually works; error is for OTHER arches

# after: force native arch
$ arch -arch arm64 node -p process.arch
'arm64'
Defensive patterns

Strategy: validation

Validate before calling

import { platform, arch } from 'process';
if (platform === 'darwin' && arch !== 'x64' && arch !== 'arm64') {
  throw new Error(`Unsupported macOS arch ${arch}; reinstall Node for x64/arm64.`);
}

Type guard

function isSupportedDarwinArch(a: string): boolean {
  return a === 'x64' || a === 'arm64';
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of parcel-bundler/parcel@59484858a1 (2026-08-13). Data as JSON: /api/errors/145255c081128642. Report an issue: GitHub.